Search code examples
workflowactiviti

How Activiti Workflow Retry mechanism work


From Activiti user guide (https://www.activiti.org/userguide/#failRetry), we can configure number of retries and retry interval as below:

<serviceTask id="failingServiceTask" activiti:async="true" activiti:class="org.activiti.engine.test.jobexecutor.RetryFailingDelegate">
    <extensionElements>      
        <activiti:failedJobRetryTimeCycle>R5/PT7M</activiti:failedJobRetryTimeCycle>
    </extensionElements>
</serviceTask>

However, a job may contain many tasks, so it will get the retry configurations from which tasks? The first task of the job or the failed task?

Moreover do I need to put the retry configuration into every tasks?

(Note: Question also posted here: https://hub.alfresco.com/t5/alfresco-process-services/how-activiti-workflow-retry-mechanism-work/td-p/292354 )


Solution

  • The complete entry of the job gets affected once an error is encountered. You can (and should) keep only one service task (generally a "JavaDelegate") per job.

    Activiti works on managing wait-states. If an error is encountered, then the transaction back until the last wait-state is rolled back.