use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgeForSequenceFlow.
@Test
public void shouldGenerateEdgeForSequenceFlow() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).done();
Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
assertEquals(1, allEdges.size());
assertBpmnEdgeExists(SEQUENCE_FLOW_ID);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesForSequenceFlowsUsingGateway.
@Test
public void shouldGenerateEdgesForSequenceFlowsUsingGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId("s1").parallelGateway("gateway").sequenceFlowId("s2").endEvent("e1").moveToLastGateway().sequenceFlowId("s3").endEvent("e2").done();
Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
assertEquals(3, allEdges.size());
assertBpmnEdgeExists("s1");
assertBpmnEdgeExists("s2");
assertBpmnEdgeExists("s3");
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceManualTask.
@Test
public void shouldPlaceManualTask() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).manualTask(TASK_ID).done();
Bounds manualTaskBounds = findBpmnShape(TASK_ID).getBounds();
assertShapeCoordinates(manualTaskBounds, 186, 78);
Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge(SEQUENCE_FLOW_ID).getWaypoints();
Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 136, 118);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 186, 118);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceThreeBoundaryEventsForSubProcess.
@Test
public void shouldPlaceThreeBoundaryEventsForSubProcess() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).boundaryEvent("boundary1").moveToActivity(SUB_PROCESS_ID).boundaryEvent("boundary2").moveToActivity(SUB_PROCESS_ID).boundaryEvent("boundary3").moveToActivity(SUB_PROCESS_ID).endEvent().done();
Bounds boundaryEvent1Bounds = findBpmnShape("boundary1").getBounds();
assertShapeCoordinates(boundaryEvent1Bounds, 343, 200);
Bounds boundaryEvent2Bounds = findBpmnShape("boundary2").getBounds();
assertShapeCoordinates(boundaryEvent2Bounds, 379, 200);
Bounds boundaryEvent3Bounds = findBpmnShape("boundary3").getBounds();
assertShapeCoordinates(boundaryEvent3Bounds, 307, 200);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldAdjustSubProcessHeight.
@Test
public void shouldAdjustSubProcessHeight() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).embeddedSubProcess().startEvent("innerStartEvent").parallelGateway("innerParallelGateway").endEvent("innerEndEvent").moveToNode("innerParallelGateway").userTask("innerUserTask").subProcessDone().done();
Bounds subProcessBounds = findBpmnShape(SUB_PROCESS_ID).getBounds();
assertThat(subProcessBounds.getHeight()).isEqualTo(298);
}
Aggregations