Bug 771854

Summary: ProcessInstance state is not updated after rollback
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Tomas Schlosser <tschloss>
Component: BRE (Expert, Fusion)Assignee: lcarlon <lcarlon>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Schlosser <tschloss>
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: brms-jira, kverlaen, lpetrovi, mproctor
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-25 02:58:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Simple reproducer (Eclipse project) none

Description Tomas Schlosser 2012-01-05 09:15:08 UTC
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:

Comment 1 Kris Verlaenen 2012-01-16 20:41:36 UTC
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.

Comment 3 Tomas Schlosser 2012-01-20 09:25:43 UTC
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.

Comment 5 Lukáš Petrovický 2012-03-20 17:31:51 UTC
Lee, this behavior and the one described in 771840 will require some careful documentation, so that we set the proper expectations.

Comment 9 Tomas Schlosser 2012-04-19 09:47:55 UTC
This is already included in BRMS BPM user guide, therefore marking the bug as verified.