Abhitocode commented on code in PR #3610:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3610#discussion_r1713127268
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java:
##########
@@ -287,180 +338,179 @@ public void
testSignalBoundaryEventOnTaskWithSignalName() throws Exception {
}
@Test
- public void testSignalBoundaryEventOnTaskComplete() throws Exception {
- kruntime =
createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn");
-
+ public void testSignalBoundaryEventOnTaskComplete() {
+ Application app = ProcessTestHelper.newApplication();
TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human
Task", handler);
-
kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER);
- KogitoProcessInstance processInstance =
kruntime.startProcess("BoundarySignalEventOnTask");
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(),
null);
- kruntime.signalEvent("MySignal", "value");
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(),
null);
- assertProcessInstanceFinished(processInstance, kruntime);
-
+ ProcessTestHelper.registerHandler(app, "Human Task", handler);
+ ProcessTestHelper.registerProcessEventListener(app,
LOGGING_EVENT_LISTENER);
+ org.kie.kogito.process.Process<BoundarySignalEventOnTaskModel>
processDefinition = BoundarySignalEventOnTaskProcess.newProcess(app);
+ BoundarySignalEventOnTaskModel model = processDefinition.createModel();
+ org.kie.kogito.process.ProcessInstance<BoundarySignalEventOnTaskModel>
instance = processDefinition.createInstance(model);
+ instance.start();
+ KogitoWorkItem workItem = handler.getWorkItem();
+ instance.completeWorkItem(workItem.getStringId(), null);
+ instance.send(Sig.of("MySignal", "value"));
Review Comment:
Hi @martinweiler It must be verifying how the process behaves when a signal
is received while a task is in progress or after it has been completed.
I tested the scenario by sending only the signal, and it worked. Similarly,
it also works by only completing the work items. I included both actions based
on the previous v7 implementation. Your insight on which approach to proceed or
keep both based on previous implementation would be helpful.
`//KogitoWorkItem workItem = handler.getWorkItem();
//instance.completeWorkItem(workItem.getStringId(), null);
instance.send(Sig.of("MySignal", "value"));
//workItem = handler.getWorkItem();
//instance.completeWorkItem(workItem.getStringId(), null);
assertThat(instance.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_COMPLETED);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]