Search in sources :

Example 6 with Waypoint

use of org.camunda.bpm.model.bpmn.instance.di.Waypoint 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);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Waypoint(org.camunda.bpm.model.bpmn.instance.di.Waypoint) Test(org.junit.Test)

Example 7 with Waypoint

use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceManyBranchesForEventBasedGateway.

@Test
public void shouldPlaceManyBranchesForEventBasedGateway() {
    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").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);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Waypoint(org.camunda.bpm.model.bpmn.instance.di.Waypoint) Test(org.junit.Test)

Example 8 with Waypoint

use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceTwoBranchesForParallelGateway.

@Test
public void shouldPlaceTwoBranchesForParallelGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).parallelGateway("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);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Waypoint(org.camunda.bpm.model.bpmn.instance.di.Waypoint) Test(org.junit.Test)

Example 9 with Waypoint

use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceTwoBranchesForEventBasedGateway.

@Test
public void shouldPlaceTwoBranchesForEventBasedGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).eventBasedGateway().id("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);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Waypoint(org.camunda.bpm.model.bpmn.instance.di.Waypoint) Test(org.junit.Test)

Example 10 with Waypoint

use of org.camunda.bpm.model.bpmn.instance.di.Waypoint in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceManyBranchesForInclusiveGateway.

@Test
public void shouldPlaceManyBranchesForInclusiveGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).inclusiveGateway("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);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Waypoint(org.camunda.bpm.model.bpmn.instance.di.Waypoint) Test(org.junit.Test)

Aggregations

Waypoint (org.camunda.bpm.model.bpmn.instance.di.Waypoint)34 Bounds (org.camunda.bpm.model.bpmn.instance.dc.Bounds)33 Test (org.junit.Test)31 ProcessBuilder (org.camunda.bpm.model.bpmn.builder.ProcessBuilder)30 BpmnShape (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape)2 Point (org.camunda.bpm.model.bpmn.instance.dc.Point)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1