Hi all,
We are working on a process that orchestrates multiple call activities. While the master process is executed a rollback can be requested from an external service.
The process reacts on this by using an event-based subprocess that is started by a message-receive-event. The rollback is processed and the master and the running call activitiy are finished.
Attached is a picture to clarify the use case.
It can be assumed that the master-process and the call-activities are in a state where it is possible to process incoming messages.
Using the flag independent='false' and using ProcessRuntime-Strategy 'Singleton' everything works fine (rollback is processed, master and the call-activity are terminated).
Using the flag independent='false' and using ProcessRuntime-Strategy 'PerProcessInstance' the rollback succeeds but afterwards an exception is thrown. Neither the master nor the call-activity is terminated:
javax.ejb.EJBException: org.jbpm.workflow.instance.WorkflowRuntimeException: [scenario-2-eventsub-master-ppi:107 - Master finished with rollback:5] -- Invalid session was used for this context org.kie.internal.runtime.manager.context.ProcessInstanceIdContext@27302139
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:165)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:250)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315)
...
Caused by: java.lang.IllegalStateException: Invalid session was used for this context org.kie.internal.runtime.manager.context.ProcessInstanceIdContext@27302139
at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager.validate(PerProcessInstanceRuntimeManager.java:145)
at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:90)
at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:266)
at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:262)
We are using jboss eap 6.1 and jbpm 6.1.0.CR2.
It would be great to get some input.
Best regards
Thomas