use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForBoundaryIntermediateEvent.
@Test
public void shouldGenerateShapeForBoundaryIntermediateEvent() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).userTask(USER_TASK_ID).endEvent(END_EVENT_ID).moveToActivity(USER_TASK_ID).boundaryEvent(BOUNDARY_ID).conditionalEventDefinition(CONDITION_ID).condition(TEST_CONDITION).conditionalEventDefinitionDone().endEvent().done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(5, allShapes.size());
assertEventShapeProperties(BOUNDARY_ID);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForScriptTask.
@Test
public void shouldGenerateShapeForScriptTask() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).scriptTask(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.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForTransaction.
@Test
public void shouldGenerateShapeForTransaction() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).transaction(TRANSACTION_ID).embeddedSubProcess().startEvent("innerStartEvent").userTask("innerUserTask").endEvent("innerEndEvent").transactionDone().endEvent(END_EVENT_ID).done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(6, allShapes.size());
assertEventShapeProperties("innerStartEvent");
assertTaskShapeProperties("innerUserTask");
assertEventShapeProperties("innerEndEvent");
BpmnShape bpmnShapeSubProcess = findBpmnShape(TRANSACTION_ID);
assertNotNull(bpmnShapeSubProcess);
assertTrue(bpmnShapeSubProcess.isExpanded());
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class DiGeneratorForFlowNodesTest method shouldGenerateShapeForCallActivity.
@Test
public void shouldGenerateShapeForCallActivity() {
// given
ProcessBuilder processBuilder = Bpmn.createExecutableProcess();
// when
instance = processBuilder.startEvent(START_EVENT_ID).callActivity(CALL_ACTIVITY_ID).endEvent(END_EVENT_ID).done();
// then
Collection<BpmnShape> allShapes = instance.getModelElementsByType(BpmnShape.class);
assertEquals(3, allShapes.size());
assertTaskShapeProperties(CALL_ACTIVITY_ID);
}
use of org.camunda.bpm.model.bpmn.builder.ProcessBuilder in project camunda-bpmn-model by camunda.
the class CoordinatesGenerationTest method shouldPlaceScriptTask.
@Test
public void shouldPlaceScriptTask() {
ProcessBuilder builder = Bpmn.createExecutableProcess();
instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).scriptTask(TASK_ID).done();
Bounds scriptTaskBounds = findBpmnShape(TASK_ID).getBounds();
assertShapeCoordinates(scriptTaskBounds, 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);
}
Aggregations