use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceExclusiveGateway.
@Test
public void shouldPlaceExclusiveGateway() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).exclusiveGateway("id").done();
Bounds gatewayBounds = findBpmnShape("id").getBounds();
assertShapeCoordinates(gatewayBounds, 186, 93);
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.instance.di.Waypoint in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceUserTask.
@Test
public void shouldPlaceUserTask() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).userTask(USER_TASK_ID).done();
Bounds userTaskBounds = findBpmnShape(USER_TASK_ID).getBounds();
assertShapeCoordinates(userTaskBounds, 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.instance.di.Waypoint in project camunda-bpmn-model by camunda.
the class AbstractBoundaryEventBuilder method setWaypointsWithSourceAndTarget.
@Override
protected void setWaypointsWithSourceAndTarget(BpmnEdge edge, FlowNode edgeSource, FlowNode edgeTarget) {
BpmnShape source = findBpmnShape(edgeSource);
BpmnShape target = findBpmnShape(edgeTarget);
if (source != null && target != null) {
Bounds sourceBounds = source.getBounds();
Bounds targetBounds = target.getBounds();
double sourceX = sourceBounds.getX();
double sourceY = sourceBounds.getY();
double sourceWidth = sourceBounds.getWidth();
double sourceHeight = sourceBounds.getHeight();
double targetX = targetBounds.getX();
double targetY = targetBounds.getY();
double targetHeight = targetBounds.getHeight();
Waypoint w1 = createInstance(Waypoint.class);
w1.setX(sourceX + sourceWidth / 2);
w1.setY(sourceY + sourceHeight);
Waypoint w2 = createInstance(Waypoint.class);
w2.setX(sourceX + sourceWidth / 2);
w2.setY(sourceY + sourceHeight + SPACE);
Waypoint w3 = createInstance(Waypoint.class);
w3.setX(targetX);
w3.setY(targetY + targetHeight / 2);
edge.addChildElement(w1);
edge.addChildElement(w2);
edge.addChildElement(w3);
}
}
use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceFollowingFlowNodeForSubProcess.
@Test
public void shouldPlaceFollowingFlowNodeForSubProcess() {
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();
Bounds endEventBounds = findBpmnShape(END_EVENT_ID).getBounds();
assertShapeCoordinates(endEventBounds, 391.5, 268);
Collection<Waypoint> sequenceFlowWaypoints = findBpmnEdge(SEQUENCE_FLOW_ID).getWaypoints();
Iterator<Waypoint> iterator = sequenceFlowWaypoints.iterator();
Waypoint waypoint = iterator.next();
assertWaypointCoordinates(waypoint, 361, 236);
while (iterator.hasNext()) {
waypoint = iterator.next();
}
assertWaypointCoordinates(waypoint, 391.5, 286);
}
Aggregations