@Test public void shouldCompleteScopeWithMultipleTokensOnSamePath() { // given final BpmnModelInstance process = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway("fork") .exclusiveGateway("join") .endEvent("end") .moveToNode("fork") .connectTo("join") .done(); testClient.deploy(process); // when testClient.createWorkflowInstance(PROCESS_ID); // then final List<Record<WorkflowInstanceRecordValue>> workflowInstanceEvents = testClient .receiveWorkflowInstances() .limitToWorkflowInstanceCompleted() .collect(Collectors.toList()); assertThat(workflowInstanceEvents) .extracting(e -> e.getValue().getElementId(), e -> e.getMetadata().getIntent()) .containsSubsequence( tuple("end", WorkflowInstanceIntent.EVENT_ACTIVATED), tuple("end", WorkflowInstanceIntent.EVENT_ACTIVATED), tuple(PROCESS_ID, WorkflowInstanceIntent.ELEMENT_COMPLETED)); }
@Test public void shouldCompleteScopeWithMultipleTokensOnSamePath() { // given final BpmnModelInstance process = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway("fork") .exclusiveGateway("join") .endEvent("end") .moveToNode("fork") .connectTo("join") .done(); testClient.deploy(process); // when testClient.createWorkflowInstance(PROCESS_ID); // then final List<Record<WorkflowInstanceRecordValue>> workflowInstanceEvents = testClient .receiveWorkflowInstances() .limitToWorkflowInstanceCompleted() .collect(Collectors.toList()); assertThat(workflowInstanceEvents) .extracting(e -> e.getValue().getElementId(), e -> e.getMetadata().getIntent()) .containsSubsequence( tuple("end", WorkflowInstanceIntent.ELEMENT_COMPLETED), tuple("end", WorkflowInstanceIntent.ELEMENT_COMPLETED), tuple(PROCESS_ID, WorkflowInstanceIntent.ELEMENT_COMPLETED)); }
@Test public void shouldCompleteInstanceAfterParallelJoin() { // given testClient.deploy( Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway("fork") .serviceTask("task-1", t -> t.zeebeTaskType("task-1")) .parallelGateway("join") .endEvent("end") .moveToNode("fork") .serviceTask("task-2", t -> t.zeebeTaskType("task-2")) .connectTo("join") .done()); testClient.createWorkflowInstance(PROCESS_ID); // when testClient.completeJobOfType("task-1"); testClient.completeJobOfType("task-2"); // then assertThatWorkflowInstanceCompletedAfter("end", WorkflowInstanceIntent.EVENT_ACTIVATED); }
@Test public void shouldCompleteInstanceAfterParallelJoin() { // given testClient.deploy( Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway("fork") .serviceTask("task-1", t -> t.zeebeTaskType("task-1")) .parallelGateway("join") .endEvent("end") .moveToNode("fork") .serviceTask("task-2", t -> t.zeebeTaskType("task-2")) .connectTo("join") .done()); testClient.createWorkflowInstance(PROCESS_ID); // when testClient.completeJobOfType("task-1"); testClient.completeJobOfType("task-2"); // then assertThatWorkflowInstanceCompletedAfter("end", WorkflowInstanceIntent.ELEMENT_COMPLETED); }
"task3", b -> b.zeebeTaskType("type3").zeebeTaskHeader(testValue, testValue)) .connectTo("end") .done();
"task3", b -> b.zeebeTaskType("type3").zeebeTaskHeader(testValue, testValue)) .connectTo("end") .done();