@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); } }