Retry javadelegate which is triggerable

Hi

We are currently using version 6.4.2 of flowable engine and have an issue with the retry logic.

We implemented a javadelegate which is triggerable and marked as asynchronous and triggerable in the model.

The execute method of the delegate sends a message to a message queue (rabbitmq). Another application then processes this message and sends a message back to our flowable service.

When it receives a message for the execution an async trigger is called for the specific execution. In case of failure the trigger propagates an exception so the service task goes to the deadletter-job queue of flowable.

The problem is when we use the move-job action to retry the job only the trigger part is executed and not the execute part so the job is actually not retried just the trigger.

To make it a bit more clearer

We have a javadelegate which is marked asynchronous & triggerable and post a message to rabbitmq.
Another java process handles the message on this queue and send a message back to flowable. This message contains success/failure.

On failure we thought we could use triggerasync and fail the servicetask by throwing a custom exception.

We do have a deadletter-job when we do this but this job only retries the trigger part and not the reexecution of the full servicetask.

When using a triggerable service task, there’s two jobs: one for the sending and one for the receving. So what you’re saying is that the first job succeeded, but the second one failed?

The job handling indeed takes that job and retries it (as the trigger failed, not the first job). For this particular use case, you probably would need to delete the second job and (re)create the original job programmatically.

We fixed it by calling moveExecutionToActivityId with the same executionId and elementId. (So in fact we restart the task)