Search in sources :

Example 31 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgeForSequenceFlow.

@Test
public void shouldGenerateEdgeForSequenceFlow() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).done();
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    assertEquals(1, allEdges.size());
    assertBpmnEdgeExists(SEQUENCE_FLOW_ID);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) Test(org.junit.Test)

Example 32 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesForSequenceFlowsUsingGateway.

@Test
public void shouldGenerateEdgesForSequenceFlowsUsingGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId("s1").parallelGateway("gateway").sequenceFlowId("s2").endEvent("e1").moveToLastGateway().sequenceFlowId("s3").endEvent("e2").done();
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    assertEquals(3, allEdges.size());
    assertBpmnEdgeExists("s1");
    assertBpmnEdgeExists("s2");
    assertBpmnEdgeExists("s3");
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) Test(org.junit.Test)

Example 33 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceManualTask.

@Test
public void shouldPlaceManualTask() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).manualTask(TASK_ID).done();
    Bounds manualTaskBounds = findBpmnShape(TASK_ID).getBounds();
    assertShapeCoordinates(manualTaskBounds, 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 34 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldPlaceThreeBoundaryEventsForSubProcess.

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

Example 35 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.

the class CoordinatesGenerationTest method shouldAdjustSubProcessHeight.

@Test
public void shouldAdjustSubProcessHeight() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).subProcess(SUB_PROCESS_ID).embeddedSubProcess().startEvent("innerStartEvent").parallelGateway("innerParallelGateway").endEvent("innerEndEvent").moveToNode("innerParallelGateway").userTask("innerUserTask").subProcessDone().done();
    Bounds subProcessBounds = findBpmnShape(SUB_PROCESS_ID).getBounds();
    assertThat(subProcessBounds.getHeight()).isEqualTo(298);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds) Test(org.junit.Test)

Aggregations

ProcessBuilder (org.camunda.bpm.model.bpmn.builder.ProcessBuilder)71 Test (org.junit.Test)70 Bounds (org.camunda.bpm.model.bpmn.instance.dc.Bounds)45 Waypoint (org.camunda.bpm.model.bpmn.instance.di.Waypoint)30 BpmnShape (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape)21 BpmnEdge (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)5