Bug 1014955

Summary: "View Process Model" displays the latest process model for old process definitions/instances
Product: [Retired] JBoss BPMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: Business CentralAssignee: Maciej Swiderski <mswiders>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Baluch <mbaluch>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: kverlaen, msalatin, mswiders
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:08:14 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:
Attachments:
Description Flags
deployments-screenshot.png
none
view-process-model.png
none
testproj1-1.0.0.jar
none
testproj1-1.1.0.jar none

Description Toshiya Kobayashi 2013-10-03 08:09:02 UTC
Description of problem:

Users can press "View Process Model" for Process Definitions or Process Instances. It will display the latest process model regardless of its version.

Steps to Reproduce:
- Create a repository 'testrepo'
- Create a project 'testproj1' with GroupID = 'com.example', ArtifactID = 'testproj1' and VersionID = '1.0.0'
- Create a process 'testprocess' with a User Task (to have a wait state) and save. Leave the version property as '1.0'
- Press "Build & Deploy" in Project Screen
- Go to [Process Management]->[Process Definitions] and click "Start" for 'testprocess 1.0'
- Go to [Process Management]->[Process Instances] and click "Details" for the 'testprocess 1.0' instance and then press "View Process Model"
 -> You will see the process model of 'testprocess 1.0'
- Edit 'testprocess' to move some node positions. Edit the version property to '1.1' and save.
- Edit project VersionID to "1.1.0" and press "File->Save" and "Build & Deploy" in Project Screen
- Go to [Process Management]->[Process Instances] and click "Details" for the 'testprocess 1.0' instance and then press "View Process Model"
 -> You will see the process model of the new 'testprocess 1.1'
- Go to [Process Management]->[Process Definitions] and click "Details" for the 'testprocess 1.0' definition and then press "Option->View Process Model"
 -> You will see the process model of the new 'testprocess 1.1'

Actual results:

"View Process Model" displays the latest process model for old process definitions/instances

Expected results:

"View Process Model" displays associated version of process model for process definitions/instances

Comment 1 Mauricio Salatino 2013-10-04 15:41:01 UTC
Ok a few things to check.
Are you sure that you have the two deployment units for your two versions of the project? You need to change the version of the project if you want to deploy it again, or undeploy the artifact before deploying the new version. 
If not the old one will not be replaced. 
Can you please check that? In the deployment screens you should see both versions.

Comment 2 Toshiya Kobayashi 2013-10-07 03:06:07 UTC
Created attachment 808700 [details]
deployments-screenshot.png

Comment 3 Toshiya Kobayashi 2013-10-07 03:07:24 UTC
Created attachment 808701 [details]
view-process-model.png

Comment 4 Toshiya Kobayashi 2013-10-07 03:09:48 UTC
Created attachment 808702 [details]
testproj1-1.0.0.jar

Comment 5 Toshiya Kobayashi 2013-10-07 03:11:30 UTC
Created attachment 808703 [details]
testproj1-1.1.0.jar

Comment 6 Toshiya Kobayashi 2013-10-07 03:13:53 UTC
(In reply to Mauricio Salatino from comment #1)
> Ok a few things to check.
> Are you sure that you have the two deployment units for your two versions of
> the project? You need to change the version of the project if you want to
> deploy it again, or undeploy the artifact before deploying the new version. 
> If not the old one will not be replaced. 
> Can you please check that? In the deployment screens you should see both
> versions.

Yes, [Deploy]->[Deployments] displays 2 deployments (com.example:testproj1 1.0.0 and 1.1.0). Attached deployments-screenshot.png.

I also attached:

- view-process-model.png which is the apprearance of displaying testprocess v1.1 (See left-top of the canvas) for deployment com.example:testproj1:1.0.0 (See 'Deployment' section in 'Definition Details' panel)
- testproj1-1.0.0.jar which contains testprocess.bpmn2 v1.0
- testproj1-1.1.0.jar which contains testprocess.bpmn2 v1.1

Let me know if you need any additional information.

Comment 7 Maciej Swiderski 2013-10-07 17:01:37 UTC
Issue was in fact with handling of process definitions that were deployed and accessed from within process definition/instance view - it was using only process id to do the look up. Now both deployment id and process id are used to find the right process definition

jbpm console
master
https://github.com/droolsjbpm/jbpm-console-ng/commit/686333b26e9c888728a1ee6cc7ca9ec636fcfac5

6.0.x
https://github.com/droolsjbpm/jbpm-console-ng/commit/ad89cda594ec56205d5a8417a7d05eb1fa0da8e2

Comment 8 Mauricio Salatino 2013-10-08 06:58:34 UTC
Awesome! Thanks for checking it Maciej!

Comment 9 Marek Baluch 2013-12-10 12:57:34 UTC
Verified on ER5.