AnsweredAssumed Answered

Activiti listener db updates - are they atomic ?

Question asked by davanna on Jun 16, 2016
Latest reply on Jun 22, 2016 by jbarrez
Hi Members,

I have written event listeners for events - PROCESS_STARTED and TASK_CREATED. In the event listener I am calling my custom db inserts (these are not activiti tables) for PROCESS_STARTED and TASK_CREATED. For PROCESS_STARTED, it inserts record into 'workflow' table and for TASK_CREATED, it inserts record into 'task' table. When I start the process by API i.e. runtimeService.startProcessInstanceByKey(workflowKey, businessKey, variables), I see that following events are emitted in the order - PROCESS_STARTED and TASK_CREATED (there are other events emitted by Activiti engine but I am only interested in these events). Tracing the execution of my code, the data got inserted into the workflow table. As there was exception in the insertion of task table for the TASK_CREATED event, the call failed. Later when I check the workflow table, I do not see any entries for workflow. Are the external insertion/updates atomic.

Thanks

Outcomes