use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceTwoBranchesForExclusiveGateway.
@Test
public void shouldPlaceTwoBranchesForExclusiveGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).exclusiveGateway("id").sequenceFlowId("s1").userTask(USER_TASK_ID).moveToNode("id").sequenceFlowId("s2").endEvent(END_EVENT_ID).done();
Bounds userTaskBounds = findBpmnShape(USER_TASK_ID).getBounds();
assertShapeCoordinates(userTaskBounds, 286, 78);
Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 286, 208);
Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge("s2").getWaypoints();
Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 211, 143);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 286, 226);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceStartEvent.
@Test
public void shouldPlaceStartEvent() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).done();
Bounds startBounds = findBpmnShape(START_EVENT_ID).getBounds();
assertShapeCoordinates(startBounds, 100, 100);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceThrowingIntermediateEvent.
@Test
public void shouldPlaceThrowingIntermediateEvent() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).intermediateThrowEvent("id").done();
Bounds throwEventBounds = findBpmnShape("id").getBounds();
assertShapeCoordinates(throwEventBounds, 186, 100);
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 shouldPlaceThreeBranchesForEventBasedGateway.
@Test
public void shouldPlaceThreeBranchesForEventBasedGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).eventBasedGateway().id("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 shouldPlaceEndEvent.
@Test
public void shouldPlaceEndEvent() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).done();
Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 186, 100);
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);
}
Aggregations