/** * Sets the current flow as the default flow. * * @return the builder */ public B defaultFlow() { final SequenceFlow sequenceFlow = getCurrentSequenceFlowBuilder().getElement(); return defaultFlow(sequenceFlow); } }
.endEvent("a") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .endEvent("b") .done();
.exclusiveGateway("joinRequest") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .connectTo("joinRequest") .endEvent("end") .done();
@Test public void shouldSplitIfDefaultFlowIsDeclaredFirst() { final BpmnModelInstance workflowDefinition = Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway() .defaultFlow() .endEvent("a") .moveToLastExclusiveGateway() .condition("$.foo < 5") .endEvent("b") .done(); testClient.deploy(workflowDefinition); // when testClient.createWorkflowInstance("workflow", MsgPackUtil.asMsgPack("foo", 10)); // then final List<Record<WorkflowInstanceRecordValue>> completedEvents = RecordingExporter.workflowInstanceRecords() .limitToWorkflowInstanceCompleted() .withIntent(WorkflowInstanceIntent.EVENT_ACTIVATED) .collect(Collectors.toList()); assertThat(completedEvents).extracting(r -> r.getValue().getElementId()).containsExactly("a"); }
.endEvent("a") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .endEvent("b") .done();
.exclusiveGateway("joinRequest") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .connectTo("joinRequest") .endEvent("end") .done();
@Test public void shouldSplitIfDefaultFlowIsDeclaredFirst() { final BpmnModelInstance workflowDefinition = Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway() .defaultFlow() .endEvent("a") .moveToLastExclusiveGateway() .condition("$.foo < 5") .endEvent("b") .done(); testClient.deploy(workflowDefinition); // when testClient.createWorkflowInstance("workflow", MsgPackUtil.asMsgPack("foo", 10)); // then final List<Record<WorkflowInstanceRecordValue>> completedEvents = RecordingExporter.workflowInstanceRecords() .limitToWorkflowInstanceCompleted() .withIntent(WorkflowInstanceIntent.ELEMENT_COMPLETED) .withElementType(BpmnElementType.END_EVENT) .collect(Collectors.toList()); assertThat(completedEvents).extracting(r -> r.getValue().getElementId()).containsExactly("a"); }
.endEvent("b") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s3") .endEvent("c") .done();
.exclusiveGateway("joinRequest") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .connectTo("joinRequest") .endEvent("end") .done();
/** * Sets the current flow as the default flow. * * @return the builder */ public B defaultFlow() { final SequenceFlow sequenceFlow = getCurrentSequenceFlowBuilder().getElement(); return defaultFlow(sequenceFlow); } }
.endEvent("b") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s3") .endEvent("c") .done();
.exclusiveGateway("joinRequest") .moveToLastExclusiveGateway() .defaultFlow() .sequenceFlowId("s2") .connectTo("joinRequest") .endEvent("end") .done();