Red Hat Bugzilla – Bug 973132
When BAM deployed with jBPM Console - tables bamtasksummary & processinstancelog not created
Last modified: 2014-08-06 16:12:29 EDT
Created attachment 759558 [details]
server log with errors - deployed with H2 database
Description of problem:
The scrips used to create initial database structure should be consolidated between BAM and jBPM Dashboard. Currently each application initializes its own version of shared tables (processinstancelog and bamtasksummary) and their definitions are not consistent. See "Actual results" section for details.
Version-Release number of selected component (if applicable):
Deploy productized dashbuilder with kie-ide (aka business-central, kie-workbench in upstream) + dashboard builder on JBoss EAP 6.1
Steps to Reproduce:
1. Configure configure H2 (and then MySQL) datasource in JBoss EAP
2. Deploy DR5 build into server (Can be downloaded from http://jawa05.englab.brq.redhat.com/candidate/BPMS-6.0.0-DR5/)
3. Check the content of the datasource after both applications are deployed
1) H2 database datasource:
there are several exceptions in the application log because BAM is trying to create several tables, that are already created by the jBPM console (see log file)
2) MySQL datas source:
Two different tables BAMTaskSummary(created by jBPM console) and bamtasksummary (created by BAM) are created.
The same with ProcessInstanceLog / processinstancelog
--> In both cases the integration between the console and BAM will not be working
The tables user for the 2 applications to interact should be consolidated in both applications. In either case the integration between the 2 applications should work.
Additional note - there is also mismatch in names of primary keys in processinstancelog tables.
In H2 database:
processinstancelog - primary key declared with name "pk"
ProcessInstanceLog - primary key declared with name "id"
See error in application log attached:
Error executing CREATE INDEX idx_ps_pk on processinstancelog(pk): Column "PK" not found; SQL statement:
Also ProcessInstanceLog created by jBPM console has some extra columns not taken into account by BAM.
This issue needs to be looked at complexly:
- Dashbuilder is supposed to read data from jBPM. Why does it try to recreate jBPM tables from its own DDL files?
- Is low-level DB access really the best way to expose the data? Exposing implementation to outside world is almnost always a bad idea.
- If it absolutely must do the above, then we must make sure that it is always deployed after jBPM - so that jBPM tables never get changed.
All that issues were caused by having the jBPM dashboard as part of the generic dashboard-builder project. The real problem is:
1.- When installed standalone (no kie-wb present) dashbuilder creates the jbpm history log tables needed by JBPM dashboard and everything works fine.
2.- But when was installed togheter with kie-wb we run into the issues you commented because jbpm tables are already created.
What we've done is to move to a separated repo all the jBPM related stuff. This new repo https://github.com/droolsjbpm/jbpm-dashboard is used to generate the artifacts belonging to the BPMS stack whereas, now, the original dashboard-builder repo only contains the generic dashboard builder stuff.
So to sum up,
1.- dashboard-builder project no longer contains jBPM related stuff. It's a generic project which in fact is being used by other projects like Teiid https://github.com/teiid/teiid-dashboard.
2.- jbpm-dashboard project is intented to be installed togheter with kie-wb or the jbpm console. If installed alone then the provided jBPM dashboard will fail because will not find the required jbpm history log tables.
With this new approach all the issues reported no longer apply.
Verified with BPMS 6.0.0 ER2