Created attachment 550858 [details] Simple reproducer (Eclipse project) Description of problem: When transaction is rolled back, the state of ProcessInstance is not changed. Version-Release number of selected component (if applicable): BRMS-5.3.0.ER1 How reproducible: Every time Steps to Reproduce: 1. start process (pi = ksession.startProcess("...")) 2. start transaction 3. abort process within transaction 4. rollback transaction 5. execute pi.getState() 6. execute ksession.getProcessInstance(pi.getId()).getState() Actual results: 5. returns STATE_ABORTED (3) 6. returns STATE_ACTIVE (1) Expected results: Both 5. and 6. return STATE_ACTIVE (1) Additional info:
The process instance that you retrieve when you execute some commands (like startProcess in this case) in combination with persistence, is a disconnected process instance, which is a snapshot of the state of the process instance when the command completed. If the process instance has changed state since that point however, it will not update itself anymore. You can however always retrieve the latest snapshot state by using ksession.getProcessInstance(id). I would say that the behaviour as described here is the expected behaviour.
It sounds logical as you described it. However if I didn't expect it I think there might be others that won't expect it either. So I suggest adding this to documentation to prevent misunderstanding in the future.
Lee, this behavior and the one described in 771840 will require some careful documentation, so that we set the proper expectations.
This is already included in BRMS BPM user guide, therefore marking the bug as verified.