use of io.camunda.zeebe.model.bpmn.builder.ProcessBuilder in project zeebe by camunda.
the class CoordinatesGenerationTest method shouldPlaceManyBranchesForExclusiveGateway.
@Test
public void shouldPlaceManyBranchesForExclusiveGateway() {
final ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).exclusiveGateway("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();
final Bounds userTaskBounds = findBpmnShape(USER_TASK_ID).getBounds();
assertShapeCoordinates(userTaskBounds, 286, 78);
final Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 286, 208);
final Bounds serviceTaskBounds = findBpmnShape(SERVICE_TASK_ID).getBounds();
assertShapeCoordinates(serviceTaskBounds, 286, 294);
final Bounds sendTaskBounds = findBpmnShape(SEND_TASK_ID).getBounds();
assertShapeCoordinates(sendTaskBounds, 286, 424);
final Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge("s1").getWaypoints();
final 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 io.camunda.zeebe.model.bpmn.builder.ProcessBuilder in project zeebe by camunda.
the class CoordinatesGenerationTest method shouldPlaceFollowingFlowNodeForSubProcess.
@Test
public void shouldPlaceFollowingFlowNodeForSubProcess() {
final ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).boundaryEvent("boundary").sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).moveToActivity(SUB_PROCESS_ID).endEvent().done();
final Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 391.5, 268);
final Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge(SEQUENCE_FLOW_ID).getWaypoints();
final Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 361, 236);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 391.5, 286);
}
use of io.camunda.zeebe.model.bpmn.builder.ProcessBuilder in project zeebe by camunda.
the class CoordinatesGenerationTest method shouldPlaceServiceTask.
@Test
public void shouldPlaceServiceTask() {
final ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).serviceTask(SERVICE_TASK_ID).done();
final Bounds serviceTaskBounds = findBpmnShape(SERVICE_TASK_ID).getBounds();
assertShapeCoordinates(serviceTaskBounds, 186, 78);
final Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge(SEQUENCE_FLOW_ID).getWaypoints();
final 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 io.camunda.zeebe.model.bpmn.builder.ProcessBuilder in project zeebe by camunda.
the class CoordinatesGenerationTest method shouldAdjustSubProcessWidth.
@Test
public void shouldAdjustSubProcessWidth() {
final 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();
final Bounds subProcessBounds = findBpmnShape(SUB_PROCESS_ID).getBounds();
assertThat(subProcessBounds.getWidth()).isEqualTo(472);
}
use of io.camunda.zeebe.model.bpmn.builder.ProcessBuilder in project zeebe by camunda.
the class CoordinatesGenerationTest method shouldPlaceBusinessRuleTask.
@Test
public void shouldPlaceBusinessRuleTask() {
final ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).businessRuleTask(TASK_ID).done();
final Bounds businessRuleTaskBounds = findBpmnShape(TASK_ID).getBounds();
assertShapeCoordinates(businessRuleTaskBounds, 186, 78);
final Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge(SEQUENCE_FLOW_ID).getWaypoints();
final Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 136, 118);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 186, 118);
}
Aggregations