Throw a BPMN Exception after retry times equals 0

Hi there…

I got a process like this figure below:

And the following code:
@Override
public void execute(DelegateExecution execution) throws Exception {
log.debug(“========== {} ==========”, execution.getCurrentActivityName());
log.debug(“Process Instance Id: {}”, execution.getProcessInstanceId());
try {
//some call to external API
} catch (Exception e) {
if (retryTimes == 0) {
throw new BPMNException();
}
}

But I don’t know how to get the retry times from the task to make this comparation.

How can I retrieve it?

Thanks in advance

Hi
Have a look at this link Pattern - Fail Faster, Best Efforts

Regards

Rob

Hi @Webcyberrob

Thanks for the help… works very fine for me here!