Dealing with failure of asynchronous service tasks invocation

In our company we don’t use Camunda Cockpit, we display all information related to Camunda and everything else in our own application’s UI. When an asynchronous service task invocation fails as part of a process instance execution, similarly to Camunda Cockpit, we want to show in our own application that there was an incident and be able to retry execution after having dealt with the cause of issue. One approach would be to follow the suggestions coming from here:

https://blog.camunda.com/post/2013/11/bpmn-service-synchronous-asynchronous/

and from here

by subclassing AbstractBpmnActivityBehavior class, use our own queue for storing intended invocations, executing them asynchronously and updating the queue to reflect whether invocation was successful or not and also have the ability to retry on failure.

Another approach would be to use the newer Camunda capabilities by resorting to Async Before/After properties of Service Tasks which were not available some time ago. However, if we use this approach, when we display information about whether service invocations succeeded or failed and be able to retry, we will need to use some Camunda API for detecting whether service task invocation failed or not, as well as for retrying. Where are these documented, please?

Any suggestions, please?

Thank you,

Cristian

Hi Cristian,

take a look at these REST endpoints:

GET /incident - you can provide processInstanceId and/or activityId to find the incidents, related with specific process instance or activity.
GET /job - the same filters as in query above, you can find the job(s) related with specific service task
PUT /job/{id}/retries - calling this you can retry the job after resolving the incident cause -> the incident will be resolved/deleted and job will be retried

Does this help you?

1 Like

Hi Svetlana,

Yes, it does help me. Thank you!

Cristian