Bug 878741 - Running task operation and process execution in one transaction for business-central
Summary: Running task operation and process execution in one transaction for business-...
Keywords:
Status: NEW
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM Console
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Kris Verlaenen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-21 05:52 UTC by Toshiya Kobayashi
Modified: 2023-05-31 22:25 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 958391 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-3862 0 Major Resolved Running task operation and process execution in one transaction for jBPM Console 2018-04-12 06:27:28 UTC

Description Toshiya Kobayashi 2012-11-21 05:52:49 UTC
Description of problem:

As business-central-server.war/WEB-INF/classes/jbpm.console.properties can configure 'Local' for task service:

====
jbpm.console.task.service.strategy=Local
====

I expected that I can use LocalTaskService/SyncWSHumanTaskHandler in business-central so that task operation and process execution can be done in the same transaction.

Actually, it allows me to use LocalTaskService/SyncWSHumanTaskHandler. But those works are still done in different transactions (threads) because StatefulKnowledgeSessionUtil.registerWorkItemHandler() doesn't call SyncWSHumanTaskHandler.setLocal(true).

=====
    private static void registerWorkItemHandler( StatefulKnowledgeSession ksession, Properties consoleProperties ) {
        if ("Local".equalsIgnoreCase(consoleProperties.getProperty("jbpm.console.task.service.strategy", TaskClientFactory.DEFAULT_TASK_SERVICE_STRATEGY))) {
            TaskService taskService = HumanTaskService.getService();
            SyncWSHumanTaskHandler handler = new SyncWSHumanTaskHandler(new LocalTaskService(taskService), ksession);
            ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
        }
=====

Also we have to take into account JBPM-3862. Community jBPM 5.4.0 has LocalHTWorkItemHandler which works in 'local' by default but still task operation and process execution are done in different transactions.

Steps to Reproduce:
1. Configure 'Local'

- Configure jbpm.console.task.service.strategy=Local in business-central-server.war/WEB-INF/classes/jbpm.console.properties

- Add "org.jbpm.task" persistence unit in business-central-server.war/WEB-INF/classes/META-INF/persistence.xml

2. Start BRMS standalone

3. Import repository_export_rollbacktest.xml via Guvnor

4. Login to business-central as john

5. Start a process 'rollbacktest'

6. Complete a Task for john

Actual results:

Process execution will be rolled back. But the Task is committed as "Completed". I observed that with MySQL

Expected results:

Both of task operation and process execution are rolled back. Hence the Taks is rolled back to "Reserved" state.

Comment 1 JBoss JIRA Server 2012-11-22 13:53:37 UTC
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3862

Fix was applied on master to ensure that both runtime engine and task service operations will be in single transaction. Very important is to have single persistence unit that will contain all definitions (for tasks and engine) and it will have transaction type set to JTA.

BTW. when changing settings of console (since 5.4) there is no need to modify files included in wars (like default.session.template or default.jbpm.console.properties). Its copies can be simply placed inside jboss_home/standalone/configuration and renamed to remove default. prefix. Console will look them up first and if not found will load defaults.

I tested it with master but without guvnor so simple exported process files and placed it on installer/sample.... directory, next to evaluation process/

Comment 2 JBoss JIRA Server 2012-11-22 13:55:14 UTC
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3862 to Resolved

Comment 3 JBoss JIRA Server 2012-11-22 13:55:14 UTC
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3862

as fix was already merged into master, resolving this.


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