Bug 973132 - When BAM deployed with jBPM Console - tables bamtasksummary & processinstancelog not created
When BAM deployed with jBPM Console - tables bamtasksummary & processinstance...
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: BAM (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ER2
: 6.0.0
Assigned To: David Gutierrez
Jan Hrcek
Depends On:
  Show dependency treegraph
Reported: 2013-06-11 06:53 EDT by Jan Hrcek
Modified: 2014-08-06 16:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:12:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
server log with errors - deployed with H2 database (2.32 KB, text/x-log)
2013-06-11 06:53 EDT, Jan Hrcek
no flags Details

  None (edit)
Description Jan Hrcek 2013-06-11 06:53:45 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):
dashbuilder DR5

How reproducible:
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

Actual results:
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

Expected results:
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 info:
Comment 1 Jan Hrcek 2013-06-11 07:46:34 EDT
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.
Comment 2 Lukáš Petrovický 2013-06-12 09:14:09 EDT
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.
Comment 3 David Gutierrez 2013-07-05 10:54:16 EDT
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.
Comment 5 Jan Hrcek 2013-09-06 07:00:56 EDT
Verified with BPMS 6.0.0 ER2

Note You need to log in before you can comment on or make changes to this bug.