Better way to model the use case in Camunda 7


I am looking on getting the design efficient. I need to make a API call depending on the response I might have to trigger two process parallelly and then depending on response of second API call I will have to suspend the other process which is being executed parallelly.

Is there anything about the way you’ve modeled it that you feel should be improved?

I have used inclusive gateway to fork the instance.

Output of service task 1 decide whether we need to execute User_Task_001 sub-process and also Service task after this inclusive gateway should be executed irrespective of the output of service task 1.

To achieve this I used ${true} as condition for this flow.

I feel there could be better way to model this instead of hard-coding true as a condition.

In addition to this the outcome of service task 2 decides whether we need to suspend the execution of User_Task_001 sub-process (if in case there is any active instance). I used signal to achieve this. Please let me know if this good way to handle this scenario.

Instead of using a hard-coded #{true} you can just make that flow the default which is probably better practice. Then that flow will always be followed

This could be a problem, a signal event can potentially trigger ever instance of the process, not just the same one. You can either make the name of the signal dynamic and unique by adding an expressing… But i think the best idea would be instead to use a conditional event.

The conditional event can be triggered by a variable produced by service 2.

Thanks for the lead on conditional event.

I have implemented both the logic by using event-based sub-process.
Having non-interrupting conditional event (to trigger the process based on outcome of service 1) and interrupting boundary conditional event (to suspend based on outcome of service 2).

Any comment or suggestions welcomed !

I always enjoy a a process with an event sub-process. :slight_smile:
This looks good to me.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.