jomarko commented on code in PR #3815:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3815#discussion_r1893470258
##########
jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/loop/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2:
##########
@@ -45,8 +45,8 @@
<startEvent id="_1" name="StartProcess" />
<userTask id="_2" name="Hello" tns:taskName="Human Task">
<extensionElements>
- <tns:onEntry-script>
-
<tns:script>System.out.println("Hello");context.setVariable("itemOut",
"test");</tns:script>
+ <tns:onEntry-script scriptFormat="http://www.java.com/java">
+
<tns:script>System.out.println("Hello");kcontext.setVariable("itemOut",
"test");</tns:script>
Review Comment:
As I sometimes need to read build logs I would like to share these ideas:
- is it worth to keep `System.out.println("Hello")`? It adds one more line
into logs, while there is still a java code `kcontext.setVariable("itemOut",
"test");` that will be executed, so we will be still sure java in entry script
works
- maybe keep the log is fine, however `"Hello"` is non unique. What do you
think about `"Hello testInclusiveSplitWithLoopInsideSubprocess"` or anything
that would be easier to greap or search in logs
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java:
##########
@@ -857,30 +857,32 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent
event) {
}
});
+
TestWorkItemHandler handler = new TestWorkItemHandler();
TestWorkItemHandler handler2 = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI",
handler);
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI2",
handler2);
- Map<String, Object> params = new HashMap<>();
- params.put("x", -1);
- KogitoProcessInstance processInstance =
kruntime.startProcess("Process_1", params);
+ ProcessTestHelper.registerHandler(app, "testWI", handler);
+ ProcessTestHelper.registerHandler(app, "testWI2", handler2);
- assertProcessInstanceActive(processInstance);
+ Process<InclusiveGatewayWithLoopInsideSubprocessModel> process =
InclusiveGatewayWithLoopInsideSubprocessProcess.newProcess(app);
Review Comment:
I am sorry, this is more my missing knowledge, where I can find the binding
of
`BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2`
and `InclusiveGatewayWithLoopInsideSubprocessProcess` ? Or is the first
mentioned edited as part of this PR but actually has noting with
`InclusiveGatewayWithLoopInsideSubprocessProcess`?
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java:
##########
@@ -837,12 +839,10 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent
event) {
}
@Test
- @Disabled("On Exit not supported, see
https://issues.redhat.com/browse/KOGITO-2067")
Review Comment:
There are 5 more tests disabled due to
`https://issues.redhat.com/browse/KOGITO-2067`, shouldn't we allow also them?
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java:
##########
@@ -857,30 +857,32 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent
event) {
}
});
+
TestWorkItemHandler handler = new TestWorkItemHandler();
TestWorkItemHandler handler2 = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI",
handler);
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI2",
handler2);
- Map<String, Object> params = new HashMap<>();
- params.put("x", -1);
- KogitoProcessInstance processInstance =
kruntime.startProcess("Process_1", params);
+ ProcessTestHelper.registerHandler(app, "testWI", handler);
+ ProcessTestHelper.registerHandler(app, "testWI2", handler2);
- assertProcessInstanceActive(processInstance);
+ Process<InclusiveGatewayWithLoopInsideSubprocessModel> process =
InclusiveGatewayWithLoopInsideSubprocessProcess.newProcess(app);
+ InclusiveGatewayWithLoopInsideSubprocessModel model =
process.createModel();
+ model.setX(-1);
+ ProcessInstance<InclusiveGatewayWithLoopInsideSubprocessModel>
instance = process.createInstance(model);
+ instance.start();
+
+ assertThat(instance.status()).isEqualTo(ProcessInstance.STATE_ACTIVE);
List<KogitoWorkItem> workItems = handler.getWorkItems();
assertThat(workItems).isNotNull().hasSize(2);
-
for (KogitoWorkItem wi : workItems) {
- assertProcessInstanceActive(processInstance);
-
kruntime.getKogitoWorkItemManager().completeWorkItem(wi.getStringId(), null);
+
assertThat(instance.status()).isEqualTo(ProcessInstance.STATE_ACTIVE);
+ instance.completeWorkItem(wi.getStringId(), null);
}
-
- assertProcessInstanceActive(processInstance);
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler2.getWorkItem().getStringId(),
null);
- assertProcessInstanceActive(processInstance);
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler2.getWorkItem().getStringId(),
null);
- assertProcessInstanceActive(processInstance);
-
kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(),
null);
- assertProcessInstanceCompleted(processInstance);
+ assertThat(instance.status()).isEqualTo(ProcessInstance.STATE_ACTIVE);
+ instance.completeWorkItem(handler2.getWorkItem().getStringId(),
null);//After this line, state of the process instance is error state instead
of active
Review Comment:
is the comment still true?
```
//After this line, state of the process instance is error state instead of
active
```
I do not see any assertion that would contain value like
`ProcessInstance.STATE_ERROR`.
--
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]