Closed Abhitocode closed 2 months ago
PR job #1
was: UNSTABLE
Possible explanation: This should be test failures
Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3583/1/display/redirect
Test results:
Those are the test failures:
Hi the test is not correct. You need to access the process instance created by the engine, not your process instance like you are doing in here. For doing so, you need to create a listener and check the event start process (at that moment you can fetch the new process instance created and matched against the the subprocess id.
@elguardian I have implemented the listener and registered, that allows me to get the sub-process instance of type 'org.kie.api.runtime.process.ProcessInstance', however in order to check the status in migrated test I need sub-process instance of type 'org.kie.kogito.process.ProcessInstance
This is how I implemented and registered the listener :
DefaultKogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @Override public void afterProcessStarted(ProcessStartedEvent event) { subProcessInstanceList.add((ProcessInstance<ErrorsBetweenSubProcessModel>) event.getProcessInstance()); } }; ProcessTestHelper.registerProcessEventListener(app, listener);
event.getProcessInstance().getId()
btw... the ProcessInstance kogito api is not the same as the ProcessInstance kie api (engine). it will throw you a class cast
Hi @elguardian Can you guide me on how to obtain the org.kie.kogito.process.ProcessInstance
@Abhitocode yes the id is the same. you can access the ProcessInstances from the definition to get the process instance
Hi @elguardian , I've implemented a ProcessEventListener to capture the process instance created by the engine, but I'm facing an issue. The beforeProcessStarted and afterProcessStarted methods of the listener are not being executed. Can you please help me understand if I'm missing something in the configuration or implementation?
Application app = ProcessTestHelper.newApplication();
org.kie.kogito.process.Process
you are registering the listener after registering the process... listener should be register before.
ActivityTest.testErrorBetweenProcessesProcess failures related. please fix
Il be submitting this particular test testErrorBetweenProcessesProcess in the upcoming pr related to DataTest.java. Removing it from this as of now.
In addition to previous changes associated, Migrated test case
testErrorBetweenProcessesProcess
but the test seems to have issue where expected state of sub process should be aborted but we are getting state pendingThe test 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
Closes https://github.com/apache/incubator-kie-issues/issues/1131.
NOTE : This pr contains test which is yet to be resolved, commented the issues for particular tests, will update and push once resolved.