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");
}
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");
}
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);
}
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);
}
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);
}
Aggregations