use of org.activiti.bpmn.model.FlowElement in project Activiti by Activiti.
the class CallActivityConverterTest method validateModel.
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("callactivity");
assertNotNull(flowElement);
assertTrue(flowElement instanceof CallActivity);
CallActivity callActivity = (CallActivity) flowElement;
assertEquals("callactivity", callActivity.getId());
assertEquals("Call activity", callActivity.getName());
assertEquals("processId", callActivity.getCalledElement());
List<IOParameter> parameters = callActivity.getInParameters();
assertEquals(2, parameters.size());
IOParameter parameter = parameters.get(0);
assertEquals("test", parameter.getSource());
assertEquals("test", parameter.getTarget());
parameter = parameters.get(1);
assertEquals("${test}", parameter.getSourceExpression());
assertEquals("test", parameter.getTarget());
parameters = callActivity.getOutParameters();
assertEquals(1, parameters.size());
parameter = parameters.get(0);
assertEquals("test", parameter.getSource());
assertEquals("test", parameter.getTarget());
}
use of org.activiti.bpmn.model.FlowElement in project Activiti by Activiti.
the class CompleteConverterTest method validateModel.
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("userTask1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof UserTask);
assertEquals("userTask1", flowElement.getId());
flowElement = model.getMainProcess().getFlowElement("catchsignal");
assertNotNull(flowElement);
assertTrue(flowElement instanceof IntermediateCatchEvent);
assertEquals("catchsignal", flowElement.getId());
IntermediateCatchEvent catchEvent = (IntermediateCatchEvent) flowElement;
assertEquals(1, catchEvent.getEventDefinitions().size());
assertTrue(catchEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition);
SignalEventDefinition signalEvent = (SignalEventDefinition) catchEvent.getEventDefinitions().get(0);
assertEquals("testSignal", signalEvent.getSignalRef());
flowElement = model.getMainProcess().getFlowElement("subprocess");
assertNotNull(flowElement);
assertTrue(flowElement instanceof SubProcess);
assertEquals("subprocess", flowElement.getId());
SubProcess subProcess = (SubProcess) flowElement;
flowElement = subProcess.getFlowElement("receiveTask");
assertNotNull(flowElement);
assertTrue(flowElement instanceof ReceiveTask);
assertEquals("receiveTask", flowElement.getId());
}
use of org.activiti.bpmn.model.FlowElement in project Activiti by Activiti.
the class PoolsConverterTest method validateModel.
private void validateModel(BpmnModel model) {
assertEquals(1, model.getPools().size());
Pool pool = model.getPools().get(0);
assertEquals("pool1", pool.getId());
assertEquals("Pool", pool.getName());
Process process = model.getProcess(pool.getId());
assertNotNull(process);
assertEquals(2, process.getLanes().size());
Lane lane = process.getLanes().get(0);
assertEquals("lane1", lane.getId());
assertEquals("Lane 1", lane.getName());
assertEquals(2, lane.getFlowReferences().size());
lane = process.getLanes().get(1);
assertEquals("lane2", lane.getId());
assertEquals("Lane 2", lane.getName());
assertEquals(2, lane.getFlowReferences().size());
FlowElement flowElement = process.getFlowElement("flow1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof SequenceFlow);
}
use of org.activiti.bpmn.model.FlowElement in project Activiti by Activiti.
the class EncodingConverterTest method validateModel.
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("writeReportTask");
assertNotNull(flowElement);
assertTrue(flowElement instanceof UserTask);
assertEquals("writeReportTask", flowElement.getId());
UserTask userTask = (UserTask) flowElement;
assertEquals("writeReportTask", userTask.getId());
assertEquals("Fazer relatório", userTask.getName());
}
use of org.activiti.bpmn.model.FlowElement in project Activiti by Activiti.
the class EventBasedGatewayConverterTest method validateModel.
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("eventBasedGateway");
assertNotNull(flowElement);
assertTrue(flowElement instanceof EventGateway);
EventGateway gateway = (EventGateway) flowElement;
List<ActivitiListener> listeners = gateway.getExecutionListeners();
assertEquals(1, listeners.size());
ActivitiListener listener = listeners.get(0);
assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
assertEquals("org.test.TestClass", listener.getImplementation());
assertEquals("start", listener.getEvent());
}
Aggregations