How to pause until task completion

Hello,
I use Camunda to communicate with a Microservice and I would like to know if it is possible to wait for the response of the Microservice call API before going to the next task, the ideal would be to be able according to the answer to say to the current task wait or go to the next task according to the response code

Here is the BPMN that I use it may be incomplete I am new to Camunda and thank you in advance for your answers

Rayane Lo

Hey @rayane_lo ,

I just see that you implement your services using Java Classes. This normally follows a synchronous behavior. Nevertheless it is also possible to implement an asynchronous invocation. This blogpost describes the concepts quiet well and links to two examples.

In general implementing the Java class with an asynchronous invocation is quiet advanced. There would be better ways around it. You could for example use a Send- and a Receive Task in your model.

Or what I would recommend is using External Tasks for the implementation. External Tasks are always asynchronously and fit quiet well to microservice architectures.

I hope this helps
Kind regards
Nele

1 Like

Thank you Nele for your quick reply
My Java Class is currently retrieving data that I implement in Input Parameters and sends them to my Microservice which receives the data, however camunda goes on to the next task without my MicroService finishing processing the data because the Microservice responds with a response code of 200 to tell Camunda it started the microservice.
I would like to know if it is possible to wait for the end of the data processing done by the micro service before going to the next task.