Suspend parent process until sub-process completes

Hi there,

I’ve designed an API that initiates a BPMN process and then expects a valid response body as an output.

The process is in charge of performing a few evaluations based on a customer’s information to determine if they’re allowed to continue with their desired purchase or not.

Some of these purchases contain “add-ons” of sorts, meaning that we offer them the ability to take Product A + Product B, but both products require their own evaluation.

As such, the process kicks off to get the relevant information required to do these evaluations, and then kicks off a multi-instance, parallel sub-process to do evaluations for each of these products.

Within this sub-process, REST service X is called, after which we need to wait for a few seconds and then call REST service Y. For this scenario, I’ve used an intermediate timer catch event to wait 5 seconds before calling the next service.

The problem I’m facing is that, once the sub-process reaches the timer and waits for the 5 seconds, the parent process completes and returns an empty REST response before the entire transaction completes.

Is there a way for me to have the parent process wait for its sub-processes (using these timer events) to complete before it ends? I’m getting very lost with regards to how I can solve this using Camunda, without having to do a Thread.sleep(5000).

Please help,