Search in sources :

Example 31 with BoundaryEvent

use of org.activiti.bpmn.model.BoundaryEvent in project Activiti by Activiti.

the class SubProcessConverterTest method validateModel.

private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("start1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof StartEvent);
    assertEquals("start1", flowElement.getId());
    flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("userTask1", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertTrue(userTask.getCandidateUsers().size() == 1);
    assertTrue(userTask.getCandidateGroups().size() == 1);
    assertTrue(userTask.getFormProperties().size() == 2);
    flowElement = model.getMainProcess().getFlowElement("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
    assertTrue(subProcess.getFlowElements().size() == 5);
    flowElement = model.getMainProcess().getFlowElement("boundaryEvent1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof BoundaryEvent);
    assertEquals("boundaryEvent1", flowElement.getId());
    BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
    assertNotNull(boundaryEvent.getAttachedToRef());
    assertEquals("subprocess1", boundaryEvent.getAttachedToRef().getId());
    assertEquals(1, boundaryEvent.getEventDefinitions().size());
    assertTrue(boundaryEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition);
}
Also used : SubProcess(org.activiti.bpmn.model.SubProcess) BoundaryEvent(org.activiti.bpmn.model.BoundaryEvent) FlowElement(org.activiti.bpmn.model.FlowElement) StartEvent(org.activiti.bpmn.model.StartEvent) UserTask(org.activiti.bpmn.model.UserTask) TimerEventDefinition(org.activiti.bpmn.model.TimerEventDefinition)

Aggregations

BoundaryEvent (org.activiti.bpmn.model.BoundaryEvent)31 FlowElement (org.activiti.bpmn.model.FlowElement)11 SubProcess (org.activiti.bpmn.model.SubProcess)8 StartEvent (org.activiti.bpmn.model.StartEvent)7 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)7 SequenceFlow (org.activiti.bpmn.model.SequenceFlow)6 SignalEventDefinition (org.activiti.bpmn.model.SignalEventDefinition)6 TimerEventDefinition (org.activiti.bpmn.model.TimerEventDefinition)6 UserTask (org.activiti.bpmn.model.UserTask)6 ErrorEventDefinition (org.activiti.bpmn.model.ErrorEventDefinition)5 CompensateEventDefinition (org.activiti.bpmn.model.CompensateEventDefinition)4 DataObject (org.activiti.bpmn.model.DataObject)4 EventDefinition (org.activiti.bpmn.model.EventDefinition)4 IntermediateCatchEvent (org.activiti.bpmn.model.IntermediateCatchEvent)4 MessageEventDefinition (org.activiti.bpmn.model.MessageEventDefinition)4 Activity (org.activiti.bpmn.model.Activity)3 Association (org.activiti.bpmn.model.Association)3 CancelEventDefinition (org.activiti.bpmn.model.CancelEventDefinition)3 Event (org.activiti.bpmn.model.Event)3 FlowNode (org.activiti.bpmn.model.FlowNode)3