AnsweredAssumed Answered

Sychronous serviceTask exception handling

Question asked by tomekzaremba on Feb 4, 2016
Latest reply on Feb 5, 2016 by jbarrez
Hey,

I have following flow in my process:
1. Call serviceTask (via JavaDelegate)
2a. If all is ok take next step in process definition
2b. If exception occurs BpmnError is thrown and is catched by errorBoundaryEvent. Then flow goes to timer and after given amount of time serviceTask should be retried.

start —> serviceTask —> serviceTask2
                  ^             |
                  |              V
                  |      errorBoundary
                  |              |
                  |              V
                  —-      timer

But there is one problem - I can't specify max number of retries. I tried to specify repeat count in timer definition, but each this did't work.

I saw that async tasks can set maxNoOfRetries, but in my case I can't switch from sync to async (next step must be executed only if previous was successfully completed).

In docs I didn't find any built-in mechanism description for my case. I have idea for one dirty solution - saving execution variable with failures count, but I won't be proud of that.

Any help or hint will be appreciated.

Outcomes