Handles failures for triggerable java service tasks

I’m not sure how to handle retries when it comes to handling failures for triggerable service tasks.

Let’s take a simple bpmn where it follows startEvent → serviceTask (async = true and triggerable = true) → endEvent

serviceTask (our custom JavaDelegate) makes rest calls to another service (let’s call serviceB) and goes to a wait state. Then serviceB will make callback to our flowable service with either SUCCESS/FAILURE callback. In case of SUCCESS callback, I can trigger and complete the task.

requirement: In case of failure callback, how do I ensure to retry the JavaDelegate.execute() method again? because the control of the flowable is in wait state of serviceTask now.

Our use case is to retry above requirement 3 times. After 3 retries move the execution to deadletter. When trying to bring back the execution from deadletter, again it should start from JavaDelegate.execute().

Hi, does anyone have some input to this issue. It would be very helpful.
Currently we are blocked due to this.

flowable version used: 6.4.1

What is a failure in this case? Is it a timeout → if so use a timer boundary event. Or is it a state being sent back? If so, why not model it with a loop back to the service task and store a process variable with a counter?

@joram, Yes it’s a state being sent from the external system.

We make http calls from our JavaDelegate and move to a wait state (as the serviceTask is marked triggerable = true). After this, we will receive a callback with status = SUCCESS/FAILED depending upon what happened with the processing of the http call we initially made.

In case of FAILURE state, we wanted to re-run the JavaDelegate again (and subsequently make another http call).