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 startProcessInstanceWithResultsapi. 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.
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.