Bug 1138412 - MortgageApplication process IllegalStateException: We cannot have more than one BAM Task Summary for the task id = 3
Summary: MortgageApplication process IllegalStateException: We cannot have more than o...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Alessandro Lazarotti
QA Contact: Marek Baluch
URL:
Whiteboard:
Depends On:
Blocks: 1206667
TreeView+ depends on / blocked
 
Reported: 2014-09-04 18:17 UTC by Jiri Svitak
Modified: 2020-03-27 20:09 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
: 1206667 (view as bug list)
Environment:
Last Closed: 2020-03-27 20:09:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
server.log (97.49 KB, text/plain)
2014-09-04 18:17 UTC, Jiri Svitak
no flags Details
mortgage.png (88.52 KB, application/octet-stream)
2014-09-04 18:19 UTC, Jiri Svitak
no flags Details

Description Jiri Svitak 2014-09-04 18:17:47 UTC
Created attachment 934582 [details]
server.log

I have run a MortgageApplication process of official BPM Example in business-central. I chose the process parameter combination so the process enters data correction human task, activates swimlane, then goes to appraisal task out of swimlane and later to 'increase down payment task' back into the swimlane. However the third task produces the following error on start operation (claim is not necessary as the claim operation was done on the first data correction task in the same swimlane):

19:14:46,932 WARN  [org.jbpm.services.task.audit.lifecycle.listeners.BAMTaskEventListener] (http-localhost.localdomain/127.0.0.1:8080-3) Something went wrong with the Task BAM Listener
19:14:46,933 WARN  [org.jbpm.services.task.persistence.TaskTransactionInterceptor] (http-localhost.localdomain/127.0.0.1:8080-3) Could not commit session: java.lang.IllegalStateException: We cannot have more than one BAM Task Summary for the task id = 9
	at org.jbpm.services.task.audit.lifecycle.listeners.BAMTaskEventListener.createOrUpdateTask(BAMTaskEventListener.java:258) [jbpm-human-task-audit-6.0.3-redhat-5.jar:6.0.3-redhat-5]

To reproduce:
1.) Setup BPMS 6.0.3.ER1 (http://dev138.mw.lab.eng.bos.redhat.com/candidate/bpms-6.0.3-ER1/) on EAP 6.1.2 (http://download.eng.brq.redhat.com/released/JBEAP-6/6.1.2/).
2.) Configure user guest with password guest, see hint below:
guest=b5d048a237bfd2874b6928e1f37ee15e
guest=admin,appraiser,broker,manager
3.) Setup official BPM example, you need to clone its repository to business-central:
http://git.app.eng.bos.redhat.com/git/jboss-bpm-example-app.git/tree/mortgage-demo-repo/src/main/resources/mortgage-demo
and also deploy its web service to EAP:
http://git.app.eng.bos.redhat.com/git/jboss-bpm-example-app.git/tree/mortgage-demo-ws
Or check the official BPM Example Application documentation.
4.) Start the BPMS.
5.) Run the remote test:
git clone git://git.app.eng.bos.redhat.com/jbossqe-process-flood.git
cd jbossqe-process-flood
git checkout bpms-6.0.x
mvn clean test -Dtest=MortgageApplicationBasicRestTest -Dmaven.test.skip=false

Expected behavior:
I do not understand where is the problem with BAM Task Summary, when this task is entered for the first time. Even if it would entered multiple times, this should not happen. The third task should be able to start without any problems.

My env:
BPMS 6.0.3.ER1
EAP 6.1.2
PostgreSQL 9.3.5

Comment 1 Jiri Svitak 2014-09-04 18:19:55 UTC
Created attachment 934583 [details]
mortgage.png

The process model view of the flow I tried to achieve. The third task 'increase down payment' cannot be started and throws an exception.

Comment 2 Kris Verlaenen 2014-09-04 19:27:38 UTC
Jiri, is it possible the database contained old information in the database (from previous executions)?

Comment 3 Jiri Svitak 2014-09-04 20:16:49 UTC
I had this in mind. The steps above are reproducible on empty database.

Comment 4 Jiri Svitak 2014-09-04 20:24:41 UTC
I see that I posted in the bug description wrong log lines with 'id = 9'. However that does not matter, the problem remains also on empty database and the attached server log has it right with 'id = 3', which corresponds to third task on empty database.

Comment 5 Maciej Swiderski 2014-09-16 12:04:22 UTC
changed applied to ensure that current transaction entities are managed by the listeners that depend on JPA queries. JPA queries will not find current transaction entities due to default (enforced by jbpm/drools persistence logic) flush mode set to COMMIT.
That was preventing BAM listener to find the task that was first added and the auto claimed within same transaction and thus creating two entries for the same task.

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/d7065d5f4b509ac44dfd1bc3b91b058ecc66d308

Comment 6 Jiri Svitak 2014-11-19 11:59:55 UTC
Verified in BPMS 6.1.0.ER2.


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