cancel
Showing results for 
Search instead for 
Did you mean: 

Record in ACT_HI_ACTINST was rollback

shanegirl
Champ on-the-rise
Champ on-the-rise
Dear Activiti Developer,

In the workflow definition, we configure the ServiceTask with asynchronous to true.
There is a few ExecutionListener configured in the ServiceTask, and one of the execution listener executed with exception. After the default retries 3 times, I check DB, there is no record created in ACT_HI_ACTINST. However, record was created in ACT_RU_EXECUTION only.

Based on my understanding, when the flow is stop at a step which required human intervention (e.g: UserTask),  record will be created in both ACT_RU_EXECUTION and ACT_HI_ACTINST table, which the last record in ACT_HI_ACTINST is sync with record in ACT_RU_EXECUTION table. Based on the situation above, record has been rollback and the servicetask record was not created in ACT_HI_ACTINST table. Is this consider as a bug? If not, is there any configuration we can do or customize so that record in ACT_HI_ACTINST will not be rollback? We need the record as we need to keep track the first start time which the service task was executed.

Please advise.

Thanks in advance.
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
The row in ACT_RU_EXECUTION represent the ongoing execution, this is there from the moment the process (or parallel path) has been started. Once a job fails, ALL modifications to the database (including creating ACT_HI_ACTINST entries and altering the ACT_RU_EXECUTION state) are rolled back. So there are no entries in ACT_HI_ACTINST because, from an engine/db perspective, those were never executed successfully.

So failing executions of any activity will NOT be marked in the history, as it never really happened. The only way to find out, is by inspecting the ACT_RU_JOB entity that is responsible for running the asynchronous task, which has zero retries left. In case you're using JTA or integrating with your own app's domain-entities, the changes to those entities that are done during the "failed" execution will also be rolled back.