Search in sources :

Example 36 with BpmnShape

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape in project camunda-bpmn-model by camunda.

the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForEventBasedGateway.

@Test
public void shouldGenerateShapeForEventBasedGateway() {
    // given
    ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
    // when
    instance = processBuilder.startEvent(START_EVENT_ID).eventBasedGateway().id("eventBased").endEvent(END_EVENT_ID).done();
    // then
    Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
    assertEquals(3, allShapes.size());
    assertGatewayShapeProperties("eventBased");
}
Also used : BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Test(org.junit.Test)

Example 37 with BpmnShape

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape in project camunda-bpmn-model by camunda.

the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForInclusiveGateway.

@Test
public void shouldGenerateShapeForInclusiveGateway() {
    // given
    ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
    // when
    instance = processBuilder.startEvent(START_EVENT_ID).inclusiveGateway("inclusive").endEvent(END_EVENT_ID).done();
    // then
    Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
    assertEquals(3, allShapes.size());
    assertGatewayShapeProperties("inclusive");
}
Also used : BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) Test(org.junit.Test)

Example 38 with BpmnShape

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape 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 39 with BpmnShape

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape 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 40 with BpmnShape

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape in project camunda-bpmn-model by camunda.

the class AbstractActivityBuilder method setBoundaryEventCoordinates.

protected void setBoundaryEventCoordinates(BpmnShape bpmnShape) {
    BpmnShape activity = findBpmnShape(element);
    Bounds boundaryBounds = bpmnShape.getBounds();
    double x = 0;
    double y = 0;
    if (activity != null) {
        Bounds activityBounds = activity.getBounds();
        double activityY = activityBounds.getY();
        double activityHeight = activityBounds.getHeight();
        double boundaryHeight = boundaryBounds.getHeight();
        x = calculateXCoordinate(boundaryBounds);
        y = activityY + activityHeight - boundaryHeight / 2;
    }
    boundaryBounds.setX(x);
    boundaryBounds.setY(y);
}
Also used : BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds)

Aggregations

BpmnShape (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape)46 ProcessBuilder (org.camunda.bpm.model.bpmn.builder.ProcessBuilder)21 Test (org.junit.Test)21 Bounds (org.camunda.bpm.model.bpmn.instance.dc.Bounds)12 SubProcess (org.camunda.bpm.model.bpmn.instance.SubProcess)4 StartEvent (org.camunda.bpm.model.bpmn.instance.StartEvent)3 BoundaryEvent (org.camunda.bpm.model.bpmn.instance.BoundaryEvent)2 Waypoint (org.camunda.bpm.model.bpmn.instance.di.Waypoint)2 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)2 ArrayList (java.util.ArrayList)1 BpmnPlane (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane)1 LabeledShape (org.camunda.bpm.model.bpmn.instance.di.LabeledShape)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1