Asynchronous continuation, BPMN error and retry behaviour

Hi there,

I have a process that executes some delegate code after a message was received. The delegate code does a web request and in case of an error it throws a BPMN error with a specific error code. As the other system might be there or not, I decided to set “asynchronous before” and a retry schedule of “R10/PT5M” to the activity with the delegate. I don’t do anything with the BPMN error in the process.

The behaviour I expect is this: In case of an error, the activity should retry for max. 10 times every 5 minutes. However, what happens is, that there’s no retry at all. The process engine tries once and that’s it. In the log I see:

2021-08-27 11:43:15.185  INFO 1 --- [pool-1-thread-1] c.y.p.d.d.DomainEventFilterActionChain   : Execute action MessageProcessAction[processInstanceId='d8694d8f-0676-11ec-80c8-e23548914be3'] after filter DomainEventAndFilter[filters=[DomainEventTypeFilter[payloadTypes=[ApprovalApprovedEvent]], DomainEventDataFilter[matchingValues=[DataItem[name='payload.id', value=81fe08e4-8c3b-4886-b74a-01dbfe27d573]]]]] matches.
2021-08-27 11:43:20.901  INFO 1 --- [aTaskExecutor-1] c.y.p.c.application.CommandService       : Sending command ChangeBusinessEventStatusCommand for process instance d8694d8f-0676-11ec-80c8-e23548914be3 and activity 'SetApprovedStatusActivity'.
2021-08-27 11:43:21.238 ERROR 1 --- [aTaskExecutor-1] c.y.p.command.application.CommandSender  : Error 400 BAD_REQUEST while sending command CommandMessage[commandType='ChangeBusinessEventStatusCommand', commandData=ChangeBusinessEventStatusCommand[id='03ebfc31-7b73-8074-7dcc-d5d173f3d49b', businessEventStatusTransitionId='fc16cfb5-a999-47b8-a0bd-1305aaf1b262', customerReference='null', toStatus='2d4bf404-f7f6-11e4-b5be-bf751bd7d02b', transitionDate='2021-08-27T11:43:20.799Z', decisionTakers='[]', transitionReason='null']] for process instance d8694d8f-0676-11ec-80c8-e23548914be3 and activity 'SetApprovedStatusActivity': {id=699114f6-a4bf-4ea2-84e4-0150601dc571, timeStamp=2021-08-27T11:43:21.234360Z, objectErrors=[{code=E11246, message=Business event '03ebfc31-7b73-8074-7dcc-d5d173f3d49b': Status transition to an invalid next status., arguments=[03ebfc31-7b73-8074-7dcc-d5d173f3d49b]}]}
2021-08-27 11:43:21.283  INFO 1 --- [aTaskExecutor-1] org.camunda.bpm.engine.bpmn.behavior     : ENGINE-02001 Execution with id 'SetApprovedStatusActivity' throws an error event with errorCode 'COMMAND_ERROR', but no catching boundary event was defined. Execution is ended (none end event semantics).

The relevant part of the process looks like this:

Where is my thinking wrong?

Thanks for any insights!

Hi @spa,

if you throw a BpmnError, no retriy is done and the error is handled in the error event.

If you throw any other exception, the retry will happen. After all retries are done, you will get an incident in the cockpit: Failed Jobs | docs.camunda.org

Hope this helps, Ingo

Thanks for the clarification. This helps!