use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceThreeBranchesForInclusiveGateway.
@Test
public void shouldPlaceThreeBranchesForInclusiveGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).inclusiveGateway("id").userTask(USER_TASK_ID).moveToNode("id").endEvent(END_EVENT_ID).moveToNode("id").sequenceFlowId("s1").serviceTask(SERVICE_TASK_ID).done();
Bounds userTaskBounds = findBpmnShape(USER_TASK_ID).getBounds();
assertShapeCoordinates(userTaskBounds, 286, 78);
Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 286, 208);
Bounds serviceTaskBounds = findBpmnShape(SERVICE_TASK_ID).getBounds();
assertShapeCoordinates(serviceTaskBounds, 286, 294);
Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge("s1").getWaypoints();
Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 211, 143);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 286, 334);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceTwoBoundaryEventsForTask.
@Test
public void shouldPlaceTwoBoundaryEventsForTask() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).userTask(USER_TASK_ID).boundaryEvent("boundary1").sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).moveToActivity(USER_TASK_ID).endEvent().moveToActivity(USER_TASK_ID).boundaryEvent("boundary2").done();
Bounds boundaryEvent1Bounds = findBpmnShape("boundary1").getBounds();
assertShapeCoordinates(boundaryEvent1Bounds, 218, 140);
Bounds boundaryEvent2Bounds = findBpmnShape("boundary2").getBounds();
assertShapeCoordinates(boundaryEvent2Bounds, 254, 140);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForReceiveTask.
@Test
public void shouldGenerateShapeForReceiveTask() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).receiveTask(TASK_ID).done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(2, allShapes.size());
assertTaskShapeProperties(TASK_ID);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForEventBasedGateway.
@Test
public void shouldGenerateShapeForEventBasedGateway() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).eventBasedGateway().id("eventBased").endEvent(END_EVENT_ID).done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(3, allShapes.size());
assertGatewayShapeProperties("eventBased");
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForInclusiveGateway.
@Test
public void shouldGenerateShapeForInclusiveGateway() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).inclusiveGateway("inclusive").endEvent(END_EVENT_ID).done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(3, allShapes.size());
assertGatewayShapeProperties("inclusive");
}
Aggregations