You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "Abhitocode (via GitHub)" <gi...@apache.org> on 2024/05/16 05:42:29 UTC
[PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Abhitocode opened a new pull request, #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519
In addition to previous changes associated with PR <https://github.com/apache/incubator-kie-kogito-runtimes/pull/3516>
Migrated some BPMN processes which are being compiled using legacy v7 to code generation approach for the same issue using new branch **incubator-kie-issues-1131-1**
The tests can be identified by referring to Activitytest.java:
https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Issue: https://github.com/apache/incubator-kie-issues/issues/1131
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#issuecomment-2121827458
**PR job** `#4` was: **UNSTABLE**
Possible explanation: This should be test failures
<details>
<summary><b>Reproducer</b></summary>
build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519 --skipParallelCheckout
NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
</details>
Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3519/4/display/redirect
**Test results:**
- PASSED: 3266
- FAILED: 1
Those are the test failures:
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3519/4/testReport/org.kie.kogito.quarkus.dmn/KogitoDMNCodeCodestartIT/testBuild/">org.kie.kogito.quarkus.dmn.KogitoDMNCodeCodestartIT.testBuild</a></summary>
process hasn't exited
</details>
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "Abhitocode (via GitHub)" <gi...@apache.org>.
Abhitocode commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1606791407
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
Okay, understood.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#issuecomment-2126285136
**PR job** `#10` was: **UNSTABLE**
Possible explanation: This should be test failures
<details>
<summary><b>Reproducer</b></summary>
build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519 --skipParallelCheckout
NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
</details>
Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3519/10/display/redirect
**Test results:**
- PASSED: 2860
- FAILED: 1
Those are the test failures:
<details>
<summary><a href="https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3519/10/testReport/org.kie.kogito.tracing/QuarkusTracingAddonDevServicesIT/testEvaluateLoanEligibility/">org.kie.kogito.tracing.QuarkusTracingAddonDevServicesIT.testEvaluateLoanEligibility</a></summary>
io.quarkus.builder.BuildException: Build failure: Build failed due to errors<br/> [error]: Build step org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor#startTrustyServiceDevService threw an exception: java.lang.RuntimeException: Failed to start Kogito TrustyService DevServices<br/> at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:145)<br/> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)<br/> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br/> at java.base/java.lang.reflect.Method.invoke(Method.java:568)<br/> at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)<br/> at io.quarkus.builder.BuildContext.run(BuildContext.java:256)<br/> at org.jbos
s.threads.ContextHandler$1.runWith(ContextHandler.java:18)<br/> at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)<br/> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)<br/> at java.base/java.lang.Thread.run(Thread.java:833)<br/> at org.jboss.threads.JBossThread.run(JBossThread.java:501)<br/>Caused by: java.lang.RuntimeException: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')<br/> at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:271)<br/> at java.base/java.u
til.Optional.orElseGet(Optional.java:364)<br/> at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyService(KogitoDevServicesProcessor.java:276)<br/> at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:133)<br/> ... 11 more<br/>Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')<br/> at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1364)<br/> at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)<br/> at org.testcontain
ers.containers.GenericContainer.start(GenericContainer.java:330)<br/> at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:267)<br/> ... 14 more<br/>Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"pull access denied for apache/incubator-kie-kogito-trusty-postgresql, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}<br/><br/> at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)<br/> at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)<br/> at java.base/java.lang.Thread.run(Thread.java:833)<br/>
</details>
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "martinweiler (via GitHub)" <gi...@apache.org>.
martinweiler commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1604606858
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
Why do we need this filter here and change the number in the assert statement from 5 to 3?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "Abhitocode (via GitHub)" <gi...@apache.org>.
Abhitocode commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1603405649
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -410,25 +392,27 @@ public void testUserTaskVerifyParameters() throws Exception {
}
@Test
- public void testCallActivityWithContantsAssignment() throws Exception {
- kruntime = createKogitoProcessRuntime(
- "org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2",
- "org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2");
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("CustomTask", handler);
- Map<String, Object> params = new HashMap<>();
- KogitoProcessInstance processInstance = kruntime.startProcess("InputMappingUsingValue", params);
-
- org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = handler.getWorkItem();
+ public void testCallActivityWithContantsAssignment() {
+ Application app = ProcessTestHelper.newApplication();
+ TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
+ ProcessTestHelper.registerHandler(app, "CustomTask", workItemHandler);
+ org.kie.kogito.process.Process<SingleTaskWithVarDefModel> singleTaskWithVarDefModelProcess = SingleTaskWithVarDefProcess.newProcess(app);
+ SingleTaskWithVarDefModel singleTaskWithVarDefModel = singleTaskWithVarDefModelProcess.createModel();
+ ProcessInstance<SingleTaskWithVarDefModel> singleTaskWithVarDefModelProcessInstance = singleTaskWithVarDefModelProcess.createInstance(singleTaskWithVarDefModel);
+
+ org.kie.kogito.process.Process<InputMappingUsingValueModel> processDefinition = InputMappingUsingValueProcess.newProcess(app);
Review Comment:
Okay
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#issuecomment-2128784275
@Abhitocode plz format code. Execute -Dvalidate-formatting
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "Abhitocode (via GitHub)" <gi...@apache.org>.
Abhitocode commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1604989438
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
I was getting an error which said something like expecting 3, so on checking, there were total 7 node instances including starting node and ending node instances. Start and end node instances were the duplicates, so total 4. Without Start and end nodes i.e., 7-4 there are 3 unique node instances.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1606758958
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
this is a bit of a hack. you can wrap something like that just getting the number of node instance triggered in the listener. Maybe you should try to put this logic within listener
numberOfNodesTriggered and check there are 3. It is more sustainable
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#issuecomment-2126564759
fix compilation failures
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "Abhitocode (via GitHub)" <gi...@apache.org>.
Abhitocode commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1604989438
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
I was getting an error which said something like expecting 3, so on checking, there were total 7 node instances including starting node and ending node instances. Start and end node instances were the duplicates, so total 4. Without Start and end nodes i.e., 7-4 there are (3) unique node instances.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian merged PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1603395806
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -410,25 +392,27 @@ public void testUserTaskVerifyParameters() throws Exception {
}
@Test
- public void testCallActivityWithContantsAssignment() throws Exception {
- kruntime = createKogitoProcessRuntime(
- "org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2",
- "org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2");
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("CustomTask", handler);
- Map<String, Object> params = new HashMap<>();
- KogitoProcessInstance processInstance = kruntime.startProcess("InputMappingUsingValue", params);
-
- org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = handler.getWorkItem();
+ public void testCallActivityWithContantsAssignment() {
+ Application app = ProcessTestHelper.newApplication();
+ TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
+ ProcessTestHelper.registerHandler(app, "CustomTask", workItemHandler);
+ org.kie.kogito.process.Process<SingleTaskWithVarDefModel> singleTaskWithVarDefModelProcess = SingleTaskWithVarDefProcess.newProcess(app);
+ SingleTaskWithVarDefModel singleTaskWithVarDefModel = singleTaskWithVarDefModelProcess.createModel();
+ ProcessInstance<SingleTaskWithVarDefModel> singleTaskWithVarDefModelProcessInstance = singleTaskWithVarDefModelProcess.createInstance(singleTaskWithVarDefModel);
+
+ org.kie.kogito.process.Process<InputMappingUsingValueModel> processDefinition = InputMappingUsingValueProcess.newProcess(app);
Review Comment:
this needs to go upper try to mix the same registering process in the same place
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "martinweiler (via GitHub)" <gi...@apache.org>.
martinweiler commented on code in PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#discussion_r1609929636
##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java:
##########
@@ -607,36 +592,40 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception {
}
@Test
- public void testSubProcessWithTerminateEndEvent() throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEvent() {
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventModel> processDefinition = SubProcessWithTerminateEndEventProcess.newProcess(app);
+ SubProcessWithTerminateEndEventModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .collect(Collectors.toSet());
+ assertThat(instance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED);
+ assertThat(processNodeEvents).hasSize(7);
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(7);
}
@Test
- public void testSubProcessWithTerminateEndEventProcessScope()
- throws Exception {
- kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2");
- final List<String> list = new ArrayList<>();
- kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() {
+ public void testSubProcessWithTerminateEndEventProcessScope() {
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- list.add(event.getNodeInstance().getNodeName());
- }
- });
- KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope");
- assertProcessInstanceCompleted(processInstance);
- assertThat(list).hasSize(5);
+ Application app = ProcessTestHelper.newApplication();
+ EventTrackerProcessListener listener = new EventTrackerProcessListener();
+ ProcessTestHelper.registerProcessEventListener(app, listener);
+ org.kie.kogito.process.Process<SubProcessWithTerminateEndEventProcessScopeModel> processDefinition = SubProcessWithTerminateEndEventProcessScopeProcess.newProcess(app);
+ SubProcessWithTerminateEndEventProcessScopeModel model = processDefinition.createModel();
+
+ org.kie.kogito.process.ProcessInstance<SubProcessWithTerminateEndEventProcessScopeModel> instance = processDefinition.createInstance(model);
+ instance.start();
+ Set<NodeInstance> processNodeEvents = listener.tracked().stream()
+ .map(ProcessNodeEvent::getNodeInstance)
+ .filter(nodeInstance -> !(nodeInstance instanceof EndNodeInstance || nodeInstance instanceof StartNodeInstance))
Review Comment:
Ok, from the processdefinition I'd expect to see 7 node triggered events instead of 5 anyway (including the duplicates for start/end), so if there is anything to question it is probably why the initial version had a check for 5.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues-1131] Process test migration from v7 legacy runtime to code generation - 1 [incubator-kie-kogito-runtimes]
Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on PR #3519:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3519#issuecomment-2121848382
@Abhitocode rebase plz
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org