use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceThreeBranchesForExclusiveGateway.
@Test
public void shouldPlaceThreeBranchesForExclusiveGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).exclusiveGateway("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.instance.dc.Bounds in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceManyBranchesForParallelGateway.
@Test
public void shouldPlaceManyBranchesForParallelGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).parallelGateway("id").userTask(USER_TASK_ID).moveToNode("id").endEvent(END_EVENT_ID).moveToNode("id").serviceTask(SERVICE_TASK_ID).moveToNode("id").sequenceFlowId("s1").sendTask(SEND_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);
Bounds sendTaskBounds = findBpmnShape(SEND_TASK_ID).getBounds();
assertShapeCoordinates(sendTaskBounds, 286, 424);
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, 464);
}
use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldAdjustSubProcessWidth.
@Test
public void shouldAdjustSubProcessWidth() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).embeddedSubProcess().startEvent("innerStartEvent").parallelGateway("innerParallelGateway").userTask("innerUserTask").endEvent("innerEndEvent").subProcessDone().done();
Bounds subProcessBounds = findBpmnShape(SUB_PROCESS_ID).getBounds();
assertThat(subProcessBounds.getWidth()).isEqualTo(472);
}
use of org.camunda.bpm.model.bpmn.instance.dc.Bounds 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.instance.dc.Bounds 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);
}
Aggregations