Hi Team,
I’ve created a façade API to start my process which has 3-4 tasks. is there any way to wait until entire process(4 tasks) gets completed before returning API response.
Thanks,
Phani
Hi Team,
I’ve created a façade API to start my process which has 3-4 tasks. is there any way to wait until entire process(4 tasks) gets completed before returning API response.
Thanks,
Phani
An easy option might be to create an contactable endpoint in your API facade that waits for a request to come back from the engine saying it’s finished.
LIke this:
Thank you. I’m calling this below snippet from my controller class. could you please provide any reference/code snippet to handle waiting.
ProcessInstanceEvent processInstance =zeebeClient
.newCreateInstanceCommand()
.bpmnProcessId(PROCESS_DISPATCH)
.latestVersion()
.variables(processVariables)
.send().join();
You wouldn’t need to write any Camunda specific code for this.
Just extend your current applcation to accept an incoming REST request and Camunda 8 can then make that request using a Camunda 8 Connector.
For instance if you’re using a springboot application you could just follow this tutorial on creating a rest endpoint
The problem is this subprocess can be called from my facade API and as well as other parent process. so ideally i will not be able to check for other incoming rest event(i mean i can’t add any other task to the existing model) . so… that’s where we got stuck. is there anyway we can handle from the background through code in the facade API like listening to processInstance etc
The other option would be to have your facade api poll Zeebe in intervals checking if the process instance has finished.
any inbuild method to check process has finished or not? or any Zeebe API to hit
There’s an Operate API that you can use
Hi @phani9613,
here is an example that may fit to your use case as well:camunda-8-examples/synchronous-response-springboot at main · camunda-community-hub/camunda-8-examples · GitHub
The client uses a unique job worker ID to get notified when the job with the matching topic will be activated. It uses asynchronous java programming in the client to achieve this even on a high load.
Hope this helps, Ingo
Thanks Ingo. will try this out.
Thanks Ingo. this reference helped us. Thanks a ton.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.