Wait till Process Instance Complete

Hi,

I am following this article Saga Orchestration Pattern for microservices with Camunda | Medium

We are starting the camunda process instance as shown in the below image.

The problem I face now is that the variable proceStartResult doesn’t wait till the process completes, it start and returns the processInstance. I have to provide the user feedback if the processStart Ended successfully or not.

Is there a way that we can wait till process completes ?

Please try out the startProcessInstanceWithResults api. It waits till the process instance completes. Note that you will have to handle timeouts. Also this api doesn’t return if there are errors encountered during the execution.

is there a similar option in .net ? or REST API for camunda which i can use ?

I dont see that as REST API in the documentation

@Hyder_Ahmed it is the same API, just in PascalCase.

Greets
Chris

Sorry, I am new to Camunda, Is the link which you are referring is cloud API ?

(Zeebe C# Client: Zeebe.Client.Api.Commands.ICreateProcessInstanceCommandStep3 Interface Reference )

I am looking for Rest API in BPM Platform (Process Instance | docs.camunda.org)

Hi @Hyder_Ahmed , I think there is some confusion, as the question is in the “Camunda Platform 8 Topics” category (which is probably why @jgeek1 and @Zelldon referenced the 8.1 APIs), but you seem to be actually interested in Camunda 7.

The example you’re referencing is utilizing external task workers, which execute the logic asynchronously, which is why your code, which starts the process instance, returns directly.

If your use case is more of a synchronous manner (e.g. you want to start the process, get some logic executed in Service Task and then retrieve the logic), you might want to create an example using Java Delegates in the Service Tasks.

A better starting point than the medium article for Camunda 7 might be Getting started with Camunda Platform | docs.camunda.org
If you’re interested in Camunda 8, I redirect you to Introduction to Camunda 8 | Camunda 8 Docs (with the addition that while Camunda 8 is executing a lot of stuff async., it is possible to retrieve the result of the process in a quasi-sync. manner, e.g. via Zeebe API (gRPC) | Camunda 8 Docs).

Kind regards,
Jens

1 Like

Thank you @Jens_Lindner, I will surely have look at Camunda 8.

I will create another topic in Camunda 7.