Search in sources :

Example 61 with ProcessBuilder

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

the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForManualTask.

@Test
public void shouldGenerateShapeForManualTask() {
    // given
    ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
    // when
    instance = processBuilder.startEvent(START_EVENT_ID).manualTask(TASK_ID).done();
    // then
    Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
    assertEquals(2, allShapes.size());
    assertTaskShapeProperties(TASK_ID);
}
Also used : BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Test(org.junit.Test)

Example 62 with ProcessBuilder

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

the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForUserTask.

@Test
public void shouldGenerateShapeForUserTask() {
    // given
    ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
    // when
    instance = processBuilder.startEvent(START_EVENT_ID).userTask(USER_TASK_ID).done();
    // then
    Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
    assertEquals(2, allShapes.size());
    assertTaskShapeProperties(USER_TASK_ID);
}
Also used : BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Test(org.junit.Test)

Example 63 with ProcessBuilder

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

the class CoordinatesGenerationTest method shouldPlaceBusinessRuleTask.

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

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder 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 65 with ProcessBuilder

use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder 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)

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