@Override BpmnModelInstance modelInstance() { return Bpmn.createExecutableProcess(processId()) .startEvent() .exclusiveGateway(elementId()) .defaultFlow() .endEvent() .done(); } },
@Override BpmnModelInstance modelInstance() { return Bpmn.createExecutableProcess(processId()) .startEvent() .exclusiveGateway(elementId()) .defaultFlow() .endEvent() .done(); } },
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("split") .sequenceFlowId("s1") .condition("$.foo < 5")
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("split") .sequenceFlowId("s1") .condition("$.foo < 5")
@Test public void shouldEndScopeIfGatewayHasNoOutgoingFlows() { final BpmnModelInstance workflowDefinition = Bpmn.createExecutableProcess("workflow").startEvent().exclusiveGateway("xor").done(); testClient.deploy(workflowDefinition); // when testClient.createWorkflowInstance("workflow", MsgPackUtil.asMsgPack("foo", 10)); // then final List<Record<WorkflowInstanceRecordValue>> completedEvents = RecordingExporter.workflowInstanceRecords() .onlyEvents() .skipUntil(r -> r.getValue().getElementId().equals("xor")) .limitToWorkflowInstanceCompleted() .collect(Collectors.toList()); assertThat(completedEvents) .extracting(r -> r.getMetadata().getIntent()) .containsExactly( WorkflowInstanceIntent.GATEWAY_ACTIVATED, WorkflowInstanceIntent.ELEMENT_COMPLETING, WorkflowInstanceIntent.ELEMENT_COMPLETED); } }
@Test public void shouldEndScopeIfGatewayHasNoOutgoingFlows() { final BpmnModelInstance workflowDefinition = Bpmn.createExecutableProcess("workflow").startEvent().exclusiveGateway("xor").done(); testClient.deploy(workflowDefinition); // when testClient.createWorkflowInstance("workflow", MsgPackUtil.asMsgPack("foo", 10)); // then final List<Record<WorkflowInstanceRecordValue>> completedEvents = RecordingExporter.workflowInstanceRecords() .onlyEvents() .skipUntil(r -> r.getValue().getElementId().equals("xor")) .limitToWorkflowInstanceCompleted() .collect(Collectors.toList()); assertThat(completedEvents) .extracting(r -> r.getMetadata().getIntent()) .containsExactly( WorkflowInstanceIntent.ELEMENT_ACTIVATING, WorkflowInstanceIntent.ELEMENT_ACTIVATED, WorkflowInstanceIntent.ELEMENT_COMPLETING, WorkflowInstanceIntent.ELEMENT_COMPLETED, WorkflowInstanceIntent.ELEMENT_COMPLETING, WorkflowInstanceIntent.ELEMENT_COMPLETED); } }
@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"); }
@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"); }
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5")
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("split") .sequenceFlowId("s1") .condition("$.foo < 5")
@Before public void init() { testClient = apiRule.partitionClient(); apiRule.waitForPartition(1); testClient.deploy( Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5") .endEvent() .moveToLastGateway() .sequenceFlowId("s2") .condition("$.foo >= 5 && $.foo < 10") .endEvent() .done()); }
@Before public void init() { testClient = apiRule.partitionClient(); apiRule.waitForPartition(1); testClient.deploy( Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5") .endEvent() .moveToLastGateway() .sequenceFlowId("s2") .condition("$.foo >= 5 && $.foo < 10") .endEvent() .done()); }
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("split") .sequenceFlowId("s1") .condition("$.foo < 5")
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5")
.exclusiveGateway() .sequenceFlowId("flow") .condition("foo")
.exclusiveGateway() .sequenceFlowId("flow") .condition("foo")
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5")
Bpmn.createExecutableProcess("workflow") .startEvent() .exclusiveGateway("xor") .sequenceFlowId("s1") .condition("$.foo < 5")