Java Code Examples for org.kie.api.runtime.process.ProcessInstance#getEventDescriptions()
The following examples show how to use
org.kie.api.runtime.process.ProcessInstance#getEventDescriptions() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testSignalBoundaryEvent() throws Exception { KieBase kbase = createKnowledgeBase( "BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn", "BPMN2-IntermediateThrowEventSignal.bpmn2"); StatefulKnowledgeSession ksession = createKnowledgeSession(kbase); TestWorkItemHandler handler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler); ProcessInstance processInstance = ksession .startProcess("BoundarySignalOnTask"); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("MySignal"); assertThat(eventDescriptions) .extracting("eventType").contains("signal"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "signal") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("AttachedToID") && m.containsKey("AttachedToName")); ProcessInstance processInstance2 = ksession .startProcess("SignalIntermediateEvent"); assertProcessInstanceFinished(processInstance2, ksession); assertProcessInstanceFinished(processInstance, ksession); }
Example 2
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testSignalBoundaryEventOnTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); ksession.addEventListener(LOGGING_EVENT_LISTENER); ProcessInstance processInstance = ksession .startProcess("BoundarySignalOnTask"); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("MySignal", "workItemCompleted"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "workItem"); assertThat(eventDescriptions) .extracting("nodeId").contains("BoundaryEvent_2", "UserTask_1"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "signal") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("AttachedToID") && m.containsKey("AttachedToName")); assertThat(eventDescriptions) .filteredOn("eventType", "signal") .hasSize(1) .extracting("nodeInstanceId").containsOnlyNulls(); assertThat(eventDescriptions) .filteredOn("eventType", "workItem") .hasSize(1) .extracting("nodeInstanceId").doesNotContainNull(); ksession.signalEvent("MySignal", "value"); assertProcessInstanceFinished(processInstance, ksession); }
Example 3
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testSignalBoundaryEventInterrupting() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SignalBoundaryEventInterrupting.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); ProcessInstance processInstance = ksession .startProcess("SignalBoundaryEvent"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("MyMessage", "workItemCompleted"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "workItem"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "signal") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("AttachedToID") && m.containsKey("AttachedToName")); ksession = restoreSession(ksession, true); ksession.signalEvent("MyMessage", null); assertProcessInstanceFinished(processInstance, ksession); }
Example 4
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test @Timeout(10) @RequirePersistence public void testEventSubprocessTimerCycle() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Script Task 1", 4); KieBase kbase = createKnowledgeBase("BPMN2-EventSubprocessTimerCycle.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ProcessInstance processInstance = ksession .startProcess("BPMN2-EventSubprocessTimer"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("workItemCompleted", "timerTriggered"); assertThat(eventDescriptions) .extracting("eventType").contains("workItem", "timer"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "timer") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("TimerID") && m.containsKey("Period")); countDownListener.waitTillCompleted(); WorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null); assertProcessInstanceFinished(processInstance, ksession); assertNodeTriggered(processInstance.getId(), "start", "User Task 1", "end", "start-sub", "Script Task 1", "end-sub"); }
Example 5
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test @Timeout(10) public void testTimerBoundaryEventDuration() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1); KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventDuration.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); ksession.addEventListener(countDownListener); ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("workItemCompleted", "timerTriggered"); assertThat(eventDescriptions) .extracting("eventType").contains("workItem", "timer"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "timer") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("TimerID") && m.containsKey("Period")); countDownListener.waitTillCompleted(); ksession = restoreSession(ksession, true); assertProcessInstanceFinished(processInstance, ksession); }
Example 6
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
@Test public void testErrorBoundaryEventOnMultiInstanceSubprocess() throws Exception { KieBase kbase = createKnowledgeBase( "subprocess/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2"); StatefulKnowledgeSession ksession = createKnowledgeSession(kbase); TestWorkItemHandler handler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler); Map<String, Object> params = new HashMap<String, Object>(); List<String> approvers = new ArrayList<String>(); approvers.add("john"); approvers.add("john"); params.put("approvers", approvers); ProcessInstance processInstance = ksession.startProcess("boundary-catch-error-event", params); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(3) .extracting("event").contains("workItemCompleted", "Inside", "Error-_D83CFC28-3322-4ABC-A12D-83476B08C7E8-MyError"); assertThat(eventDescriptions) .extracting("eventType").contains("workItem", "signal"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "signal") .hasSize(2) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("AttachedToID") && m.containsKey("AttachedToName")); List<WorkItem> workItems = handler.getWorkItems(); assertThat(workItems).isNotNull(); assertThat(workItems.size()).isEqualTo(2); ksession.signalEvent("Inside", null, processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); ksession.dispose(); }
Example 7
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testEventBasedSplit() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes ProcessInstance processInstance = ksession .startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("Yes", "No"); assertThat(eventDescriptions) .extracting("eventType").contains("signal"); assertThat(eventDescriptions) .extracting("dataType").hasOnlyElementsOfType(NamedDataType.class).extracting("dataType").hasOnlyElementsOfType(StringDataType.class); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .extracting("nodeInstanceId").doesNotContainNull(); ksession.signalEvent("Yes", "YesValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); // No processInstance = ksession.startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.signalEvent("No", "NoValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); }
Example 8
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test @Timeout(10) public void testEventBasedSplit2() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 2); KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit2.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.addEventListener(countDownListener); // Yes ProcessInstance processInstance = ksession .startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("Yes", "timerTriggered"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "timer"); assertThat(eventDescriptions).filteredOn(i -> i.getDataType() != null) .extracting("dataType").hasOnlyElementsOfType(NamedDataType.class).extracting("dataType").hasOnlyElementsOfType(StringDataType.class); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "timer") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("TimerID") && m.containsKey("Delay")); ksession = restoreSession(ksession, true); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.signalEvent("Yes", "YesValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); ksession = restoreSession(ksession, true); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession = restoreSession(ksession, true); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Timer processInstance = ksession.startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); ksession = restoreSession(ksession, true); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); assertProcessInstanceFinished(processInstance, ksession); }
Example 9
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testEventBasedSplit3() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit3.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); Person jack = new Person(); jack.setName("Jack"); // Yes ProcessInstance processInstance = ksession .startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("Yes"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "conditional"); assertThat(eventDescriptions).filteredOn(i -> i.getDataType() != null) .extracting("dataType").hasOnlyElementsOfType(NamedDataType.class).extracting("dataType").hasOnlyElementsOfType(StringDataType.class); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.signalEvent("Yes", "YesValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); // Condition processInstance = ksession.startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.insert(jack); assertProcessInstanceFinished(processInstance, ksession); }
Example 10
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testEventBasedSplit4() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit4.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes ProcessInstance processInstance = ksession .startProcess("com.sample.test"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("Message-YesMessage", "Message-NoMessage"); assertThat(eventDescriptions) .extracting("eventType").contains("message", "message"); assertThat(eventDescriptions) .extracting("dataType").hasOnlyElementsOfType(NamedDataType.class).extracting("dataType").hasOnlyElementsOfType(StringDataType.class); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ksession.signalEvent("Message-YesMessage", "YesValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); ksession = restoreSession(ksession, true); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // No processInstance = ksession.startProcess("com.sample.test"); ksession.signalEvent("Message-NoMessage", "NoValue", processInstance.getId()); assertProcessInstanceFinished(processInstance, ksession); }
Example 11
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public void runTestEventSubprocessSignal(String processFile, String [] completedNodes) throws Exception { KieBase kbase = createKnowledgeBase(processFile); final List<String> executednodes = new ArrayList<>(); ProcessEventListener listener = new DefaultProcessEventListener() { @Override public void afterNodeLeft(ProcessNodeLeftEvent event) { if (event.getNodeInstance().getNodeName() .equals("sub-script")) { executednodes.add(event.getNodeInstance().getId()); } } }; ksession = createKnowledgeSession(kbase); ksession.addEventListener(listener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ProcessInstance processInstance = ksession .startProcess("BPMN2-EventSubprocessSignal"); assertProcessInstanceActive(processInstance); ksession = restoreSession(ksession, true); ksession.addEventListener(listener); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("MySignal", "workItemCompleted"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "workItem"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); ksession.signalEvent("MySignal", null, processInstance.getId()); assertProcessInstanceActive(processInstance); ksession.signalEvent("MySignal", null); assertProcessInstanceActive(processInstance); ksession.signalEvent("MySignal", null); assertProcessInstanceActive(processInstance); ksession.signalEvent("MySignal", null); assertProcessInstanceActive(processInstance); WorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null); assertProcessInstanceFinished(processInstance, ksession); assertNodeTriggered(processInstance.getId(), completedNodes ); assertThat(executednodes.size()).isEqualTo(4); }
Example 12
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test public void testEventSubprocessMessage() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventSubprocessMessage.bpmn2"); final List<String> executednodes = new ArrayList<>(); ProcessEventListener listener = new DefaultProcessEventListener() { @Override public void afterNodeLeft(ProcessNodeLeftEvent event) { if (event.getNodeInstance().getNodeName() .equals("Script Task 1")) { executednodes.add(event.getNodeInstance().getId()); } } }; ksession = createKnowledgeSession(kbase); ksession.addEventListener(listener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ProcessInstance processInstance = ksession .startProcess("BPMN2-EventSubprocessMessage"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("Message-HelloMessage", "workItemCompleted"); assertThat(eventDescriptions) .extracting("eventType").contains("signal", "workItem"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); ksession = restoreSession(ksession, true); ksession.addEventListener(listener); ksession.signalEvent("Message-HelloMessage", null, processInstance.getId()); ksession.signalEvent("Message-HelloMessage", null); ksession.signalEvent("Message-HelloMessage", null); ksession.signalEvent("Message-HelloMessage", null); ksession.getProcessInstance(processInstance.getId()); ksession.getProcessInstance(processInstance.getId()); ksession.getProcessInstance(processInstance.getId()); ksession.getProcessInstance(processInstance.getId()); WorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null); assertProcessInstanceFinished(processInstance, ksession); assertNodeTriggered(processInstance.getId(), "start", "User Task 1", "end", "Sub Process 1", "start-sub", "Script Task 1", "end-sub"); assertThat(executednodes.size()).isEqualTo(4); }
Example 13
Source File: IntermediateEventTest.java From kogito-runtimes with Apache License 2.0 | 4 votes |
@Test @Timeout(10) public void testEventSubprocessTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Script Task 1", 1); KieBase kbase = createKnowledgeBase("BPMN2-EventSubprocessTimer.bpmn2"); ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ProcessInstance processInstance = ksession .startProcess("BPMN2-EventSubprocessTimer"); assertProcessInstanceActive(processInstance); Set<EventDescription<?>> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(2) .extracting("event").contains("workItemCompleted", "timerTriggered"); assertThat(eventDescriptions) .extracting("eventType").contains("workItem", "timer"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); assertThat(eventDescriptions) .filteredOn("eventType", "timer") .hasSize(1) .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("TimerID") && m.containsKey("Delay")); countDownListener.waitTillCompleted(); eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) .hasSize(1) .extracting("event").contains("workItemCompleted"); assertThat(eventDescriptions) .extracting("eventType").contains("workItem"); assertThat(eventDescriptions) .extracting("processInstanceId").contains(processInstance.getId()); WorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null); assertProcessInstanceFinished(processInstance, ksession); assertNodeTriggered(processInstance.getId(), "start", "User Task 1", "end", "Sub Process 1", "start-sub", "Script Task 1", "end-sub"); }