I’m trying to understand the retry behavior of an external service task but I’m not able to find into the documentation and I would like if the current behavior that I have is the normal one.
I have a basic service external task (content doesn’t matter) with a start execution listener and an end execution listener too.
The external task behavior is to catch each Exception as an incident with handleFailure(...) method and a positive retry.
Based on this picture :
It seems that when the external task raised an incident and the retry happen, the start execution listener is not called again.
Is that normal ? My need is to restart at step 2 rather than step 3.
Looking at the Camunda docs External Tasks | docs.camunda.org it says: “When setting retries to a value > 0, the task can be fetched again after retryTimeout expires. When setting retries to 0, a task can no longer be fetched and an incident is created for this task”
I expect that retries for external task is a matter of having the engine offer a task again, if an external worker could not process the task successfully. The handleFailure method is to instruct the engine on how to do that (either offer it again or create an incident).
I have not tested this, but I dont think you can expect the token to be moved back to the start of the activity and have the listener executed again.
Micheal is correct: The start listener is not executed again. As the listener is part of the previous transaction and this transaction is already commited when the external-task gets available to the fetch & lock mechanism, it will not be rolled back after the external-task-handler calls handleFailure(...).