Search in sources :

Example 51 with FlowElement

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());
}
Also used : IOParameter(org.activiti.bpmn.model.IOParameter) FlowElement(org.activiti.bpmn.model.FlowElement) CallActivity(org.activiti.bpmn.model.CallActivity)

Example 52 with FlowElement

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());
}
Also used : SubProcess(org.activiti.bpmn.model.SubProcess) ReceiveTask(org.activiti.bpmn.model.ReceiveTask) FlowElement(org.activiti.bpmn.model.FlowElement) IntermediateCatchEvent(org.activiti.bpmn.model.IntermediateCatchEvent) UserTask(org.activiti.bpmn.model.UserTask) SignalEventDefinition(org.activiti.bpmn.model.SignalEventDefinition)

Example 53 with FlowElement

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);
}
Also used : FlowElement(org.activiti.bpmn.model.FlowElement) SequenceFlow(org.activiti.bpmn.model.SequenceFlow) Lane(org.activiti.bpmn.model.Lane) Pool(org.activiti.bpmn.model.Pool) Process(org.activiti.bpmn.model.Process)

Example 54 with FlowElement

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());
}
Also used : FlowElement(org.activiti.bpmn.model.FlowElement) UserTask(org.activiti.bpmn.model.UserTask)

Example 55 with FlowElement

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());
}
Also used : EventGateway(org.activiti.bpmn.model.EventGateway) FlowElement(org.activiti.bpmn.model.FlowElement) ActivitiListener(org.activiti.bpmn.model.ActivitiListener)

Aggregations

FlowElement (org.activiti.bpmn.model.FlowElement)77 SubProcess (org.activiti.bpmn.model.SubProcess)27 UserTask (org.activiti.bpmn.model.UserTask)26 SequenceFlow (org.activiti.bpmn.model.SequenceFlow)24 StartEvent (org.activiti.bpmn.model.StartEvent)14 Process (org.activiti.bpmn.model.Process)13 ArrayList (java.util.ArrayList)11 BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)11 HashMap (java.util.HashMap)9 ActivitiListener (org.activiti.bpmn.model.ActivitiListener)9 Activity (org.activiti.bpmn.model.Activity)9 ServiceTask (org.activiti.bpmn.model.ServiceTask)9 Gateway (org.activiti.bpmn.model.Gateway)8 GraphicInfo (org.activiti.bpmn.model.GraphicInfo)7 TimerEventDefinition (org.activiti.bpmn.model.TimerEventDefinition)7 Artifact (org.activiti.bpmn.model.Artifact)6 FlowNode (org.activiti.bpmn.model.FlowNode)6 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)6 BpmnModel (org.activiti.bpmn.model.BpmnModel)5 EventDefinition (org.activiti.bpmn.model.EventDefinition)5