Bug 861898

Summary: Process Instance Diagram in jBPM Console shows wrong multiple markers due to the ordering of JPAProcessInstanceDbLog.findNodeInstances()
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: BRMS 5.3.0.GACC: alazarot, ashosheh
Target Milestone: ER4   
Target Release: BRMS 5.3.1 GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Due to the way different databases handle timestamps the log events could be returned out of order. This resulted in incorrect markers on the diagrams in business central. This issues has been resolved by ensuring that data (events) fetched from the database are ordered by ID, this ensures the correct order is returned and the markers on process diagrams are correct.
Story Points: ---
Clone Of: Environment:
Last Closed: 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
repository_export_multiplemarkers.zip
none
testprocess.png none

Description Toshiya Kobayashi 2012-10-01 09:30:33 UTC
Description of problem:

Platform BZ for https://issues.jboss.org/browse/JBPM-3813 

How reproducible:

Cannot reprocude on my side. But a customer can reproduce it constantly. Non-reproducible issue may not be accepted but we can guess the root cause and the fix is reasonable.

Steps to Reproduce:
1. Create a process with some Script task nodes and one Human task node. (See attached repository_export_multi_marker_issue.zip)
2. Start a process with jBPM Console
3. Click 'Diagram' button 
  
Actual results:

The diaglam has multiple markers. (See attached testprocess.png from the customer)

Expected results:

The diaglam has one marker on a Human task node.

Comment 1 Toshiya Kobayashi 2012-10-01 09:57:12 UTC
Created attachment 619726 [details]
repository_export_multiplemarkers.zip

Comment 2 Toshiya Kobayashi 2012-10-01 09:58:06 UTC
Created attachment 619728 [details]
testprocess.png

Comment 3 JBoss JIRA Server 2012-10-02 11:52:33 UTC
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3813

As mentioned in pull request, changing order of the query to provide first all enter events and then exit events could cause some issues if someone that uses this method relies on enter-exit pairs (even though this issue is about that not every time such order is delivered). 

I see two alternative options:
1. change order of the queries to be "date, id" where id is identifier from sequence so exit event should never have smaller value than enter for the same node instance
2. implement sorting mechanism in GraphViewerPluginImpl.getActiveNodeInfo() to sort it first enter events and then exit events and keep the logic of that method unchanged

Wdyt?

Comment 4 JBoss JIRA Server 2012-10-03 00:56:03 UTC
Toshiya Kobayashi <tkobayas> made a comment on jira JBPM-3813

Thanks Maciej,

Yeah, you are right. I think option 1 is better because it would prevent future issues like this.

Comment 5 JBoss JIRA Server 2012-10-03 13:55:56 UTC
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3813

Toshiya, is it ok to close pull request for this? I'll make changes and push it into master as agreed.

Thanks

Comment 6 JBoss JIRA Server 2012-10-03 14:11:26 UTC
Toshiya Kobayashi <tkobayas> made a comment on jira JBPM-3813

Sure, thanks.

Comment 7 JBoss JIRA Server 2012-10-04 12:15:08 UTC
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3813 to Resolved

Comment 8 JBoss JIRA Server 2012-10-04 12:15:08 UTC
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3813

implemented option 1 (added id into order by) and merged into master and 5.4.x

Comment 9 Lukáš Petrovický 2012-10-04 12:44:02 UTC
*** Bug 806896 has been marked as a duplicate of this bug. ***

Comment 12 Maciej Swiderski 2012-10-10 12:57:58 UTC
merged into 5.2.x

Comment 13 Zuzana Krejčová 2012-11-15 13:40:55 UTC
I haven't seen this issue in ER4 in any of the tests run. This issue is either fixed or so well hidden that it can be considered non-existent.

Comment 17 ashosheh 2013-12-24 14:07:42 UTC
We have downloaded and installed BRMS 5.3.1 on Oracle Database 11g, however we still see two wrong markers when we display process instance map.
Given that we downloaded the latest jbpm-bam-5.3.1.BRMS.jar which contains the correct ordering in JPAProcessInstanceDbLog.findNodeInstances().
On the other hand we tried rebuilding the guvnor packages again but didn't work as well.