Search in sources :

Example 51 with Bounds

use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceManyBoundaryEventsForTask.

@Test
public void shouldPlaceManyBoundaryEventsForTask() {
    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").moveToActivity(USER_TASK_ID).boundaryEvent("boundary3").moveToActivity(USER_TASK_ID).boundaryEvent("boundary4").done();
    Bounds boundaryEvent1Bounds = findBpmnShape("boundary1").getBounds();
    assertShapeCoordinates(boundaryEvent1Bounds, 218, 140);
    Bounds boundaryEvent2Bounds = findBpmnShape("boundary2").getBounds();
    assertShapeCoordinates(boundaryEvent2Bounds, 254, 140);
    Bounds boundaryEvent3Bounds = findBpmnShape("boundary3").getBounds();
    assertShapeCoordinates(boundaryEvent3Bounds, 182, 140);
    Bounds boundaryEvent4Bounds = findBpmnShape("boundary4").getBounds();
    assertShapeCoordinates(boundaryEvent4Bounds, 218, 140);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Test(org.junit.Test)

Example 52 with Bounds

use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceInclusiveGateway.

@Test
public void shouldPlaceInclusiveGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).inclusiveGateway("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);
}
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 53 with Bounds

use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceThreeBranchesForParallelGateway.

@Test
public void shouldPlaceThreeBranchesForParallelGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).parallelGateway("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);
}
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 54 with Bounds

use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceServiceTask.

@Test
public void shouldPlaceServiceTask() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).serviceTask(SERVICE_TASK_ID).done();
    Bounds serviceTaskBounds = findBpmnShape(SERVICE_TASK_ID).getBounds();
    assertShapeCoordinates(serviceTaskBounds, 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);
}
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 55 with Bounds

use of org.camunda.bpm.model.bpmn.instance.dc.Bounds in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceManyBoundaryEventsForSubProcess.

@Test
public void shouldPlaceManyBoundaryEventsForSubProcess() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).boundaryEvent("boundary1").moveToActivity(SUB_PROCESS_ID).boundaryEvent("boundary2").moveToActivity(SUB_PROCESS_ID).boundaryEvent("boundary3").moveToActivity(SUB_PROCESS_ID).boundaryEvent("boundary4").moveToActivity(SUB_PROCESS_ID).endEvent().done();
    Bounds boundaryEvent1Bounds = findBpmnShape("boundary1").getBounds();
    assertShapeCoordinates(boundaryEvent1Bounds, 343, 200);
    Bounds boundaryEvent2Bounds = findBpmnShape("boundary2").getBounds();
    assertShapeCoordinates(boundaryEvent2Bounds, 379, 200);
    Bounds boundaryEvent3Bounds = findBpmnShape("boundary3").getBounds();
    assertShapeCoordinates(boundaryEvent3Bounds, 307, 200);
    Bounds boundaryEvent4Bounds = findBpmnShape("boundary4").getBounds();
    assertShapeCoordinates(boundaryEvent4Bounds, 343, 200);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Test(org.junit.Test)

Aggregations

Bounds (org.camunda.bpm.model.bpmn.instance.dc.Bounds)60 ProcessBuilder (org.camunda.bpm.model.bpmn.builder.ProcessBuilder)45 Test (org.junit.Test)45 Waypoint (org.camunda.bpm.model.bpmn.instance.di.Waypoint)33 BpmnShape (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape)12 StartEvent (org.camunda.bpm.model.bpmn.instance.StartEvent)2 SubProcess (org.camunda.bpm.model.bpmn.instance.SubProcess)2 ArrayList (java.util.ArrayList)1 BoundaryEvent (org.camunda.bpm.model.bpmn.instance.BoundaryEvent)1 BpmnPlane (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1