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.
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/
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3862 to Resolved
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3862 as fix was already merged into master, resolving this.