Automatic exception handling for External-Tasks

Hi community,

I want to share my idea with you. Currently I work in a setting where we use lot of external-task-workers. Our task-handlers are built on the official java-client provieded by Camunda. :robot:

Thinking about retries, we realized that the retry-behaviour has to be implemented in each and every handler separatley (right?), i.e.

  • write some try-catch
  • handle errors and think about handling
  • finally calculate number of remaining retries as well as the next timeout

So we came up with a small spring-boot-starter facing this issue. With this starter you can specify the retry-behaviour within the process-model as usual, using an expression like R3/PT10M - as it possbile for ServiceTasks with DelegateExpression, but only as ExtensionProperty.

The starter then

  • does a retry for any error that occoured, of course only if any retry remains
  • evaluates the retry-behaviour and determines the next timeout
  • probably skips retries, if InstantIncidentException
  • or creates a bpmn-error, if ExternalTaskBusinessError

Please tell me what you think about this helper. Be aware that this is currently more a proof-of-concept and not set free to the wild. Further, this functionality might be part of the java-client itself in the future(?) :wink: :nerd_face:

Cheers, Flo :v:

3 Likes