Loop on error event with 1 second delay on service task

hi

in my business when process reach payment service task, Money must be deposited. so if this service throw BpmnError i catch it for retry again. for that i design this this diagram

with timer definition cycle equal to this pattern {0/5 * * * * ?} (every 5 second). but this create extra call on service task because service task throw BpmnError again… and that is unpredictable happening for me!

what is best practice for this problem and set a delay only after catch BpmnError for retry again after 5 second ?

thanks

Hello @Amir_Azizkhaniroshan ,

you could use the retry mechanism provided by the engine.

https://docs.camunda.org/manual/latest/user-guide/process-engine/the-job-executor/#retry-time-cycle-configuration

By this, you keep your business process clean from any technical errors.

Hope this helps

Jonathan

2 Likes