Bug 1024233

Summary: 'Total process instances' not counted correctly on MS SQL 2008 and on MySQL 5.5
Product: [Retired] JBoss BPMS Platform 6 Reporter: Jan Hrcek <jhrcek>
Component: BAMAssignee: Jan <jschatte>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Hrcek <jhrcek>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: pzapataf
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:13:15 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
Screenshot
none
server.log showing creation of processinstancelog none

Description Jan Hrcek 2013-10-29 07:54:06 UTC
Created attachment 816996 [details]
Screenshot

Description of problem:
When using the following databases, the total process count in jbpm dashboard is not displayed correctly:
1) MS SQL 2008 R2
2) MySQL 5.0

Please review the query that counts total process instances.



Version-Release number of selected component (if applicable):
BPMS 6.0.0 ER4
+ one of 2 databases as underlying datasource
+ firefox 17

How reproducible:
Always

Steps to Reproduce:
1. I have 2 process definitions: 1 process with script task and 1 process with human task.
2. I start 2 instances of 1st process and 3 instances of 2nd process and then I abort 1 instance of the 2nd process.
3. Then I check jBPM Dashboard to see if dashboards about these processes display data correctly.

Actual results:
See screenshot - As you can see the 'total process instances' metric is not counting the 5 existing process instances correctly - it only shows 3. But other KPIs display correct result, for example 'Instances srarted by user' chart shows 5, or completed + active + aborted = 5

Expected results:
Total process instances should display 5

Comment 1 Jan Hrcek 2013-10-29 11:02:00 UTC
For completeness: on other databases we are testing with it's working correctly - e.g. on Oracle 11g R2, PostgreSQL 9.2 and 8.4

Comment 2 Jan 2013-11-05 13:37:08 UTC
Did you deploy the complete business central application on mysql, or just the jbpm dashboards part?

Comment 3 Jan Hrcek 2013-11-05 14:00:39 UTC
In all cases I deployed the whole BPMS product (business-central.war + dashbuilder.war), downloaded from here: http://dev138.mw.lab.eng.bos.redhat.com/candidate/bpms-6.0.0-ER4/

Also I'm sure, the configuration is correct (it's actually done by scripts to ensure test reproducibility), as other KPIs of dashbuilder are displaying the complete data correctly.

Comment 4 Jan 2013-11-06 10:48:32 UTC
Don't worry, i was just asking because i'm encountering some difficulties in deploying the jbpm-dashboards war.
Did you have to apply any manual changes to deploy it (e.g. additional hibernate properties in the persistence.xml file), or do you create the business-central data model by script instead of automatically?
More specifically, i'm encountering that the "ProcessInstanceLog" (business-central) table is being referenced from one of the jbpm-dashb kpi's as "processinstancelog", which leads to an error when installing that kpi, since MySQL is case sensitive, so I'm curious as to how your environment manages to run correctly.

Comment 5 Jan Hrcek 2013-11-06 14:08:06 UTC
In our tests the BPMS product is configured by scripts. As far as I know the only configuration change we are doing via scripts to the BPMS product wars are:

1) in persistence.xml of business-central.war we specify hibernate dialect org.hibernate.dialect.MySQL5InnoDBDialect + reference to our own mysql datasource (declared in standalone.xml)

2) in jboss-deployment-structore of dashbuilder war we add reference to EAP module for Mysql 5.5 jdbc driver + in dashbuilder-jboss-web.xml we add reference to the same mysql datasource as in 1)

The database schema is then created automatically when business-central.war is deployed. Interestingly, I don't see any errors about table names anywhere in the logs / in application(s). Where do you see those errors, in server.log?
Did you try to reproduce the bug with BPMS 6.0.0 ER4 + EAP 6.1 (the setup is easy - you just need to unzip EAP + BPMS - see download link in comment 3)?

For your reference I attach server.log created by one of the test runs where this bugzilla issue manifested itself. You can see how the tables are created by business central + no errors for dashbuilder KPIs.

Comment 6 Jan Hrcek 2013-11-06 14:09:35 UTC
Created attachment 820389 [details]
server.log showing creation of processinstancelog

Comment 7 Jan 2013-11-07 12:11:06 UTC
Fixed in the following commits:

master: https://github.com/droolsjbpm/jbpm-dashboard/commit/131c247

6.0.x: https://github.com/droolsjbpm/jbpm-dashboard/commit/e24c61b


In the end the origin of this problem was faulty configuration of the counter kpi, so it did not have any relation with the type of database. This is strange since you mentioned that on other databases it worked correctly. Please do recheck this specific point on the other supported databases to see if by fixing the configuration issue any other - possibly hidden - problem surfaces.

Thanx for the info you provided! - in the end my installation problems were due to network latency (took forever to complete DB access operations since I was working against a remote mysql installation); as soon as I switched to a local DB things went smoothly.

Comment 8 Jan 2013-11-22 16:38:36 UTC
It appears the problem was only partly solved for the commits above, i.e. it only displays the correct result when default language is English. For the other languages the correction is include in the commits for another bugfix that also required re-exporting the jbpm workspace:

dashboard-builder: 
master: http://github.com/droolsjbpm/dashboard-builder/commit/15497aaea
6.0.x: http://github.com/droolsjbpm/dashboard-builder/commit/448a81808

jbpm-dashboard:
master: http://github.com/droolsjbpm/jbpm-dashboard/compare/c654f93...64cb161
6.0.x: http://github.com/droolsjbpm/jbpm-dashboard/compare/c593fb3...0293c06

Comment 9 Jan Hrcek 2013-12-02 12:27:09 UTC
Ok, problem has been fixed in BPMS 6.0.0 ER5