How do I wait for all of N parallel async events to arrive in a workflow?

Mohit Mehra: Hi Team ,
Can I do like this merging different events from xor to parllel @korthout if not then how can I implement this use case where every event is mandatory and has to be clubbed and then move to next stage …Source system can give us any event out of sequence

korthout: If you need to wait for all these events, why not change the first xor into a parallel gateway?

Mohit Mehra: But parallel gateway will send it to all the states if like I get event of type order received won’t it send that to all event types …

Mohit Mehra: In parallel gateway how can I put condition where to go?

korthout: you mentioned every event is mandatory. That is when you would use a parallel gateway (logical AND) to split and wait until all flows have converged again.

> In parallel gateway how can I put condition where to go?
Zeebe does not yet support the inclusive gateway (logical OR), which would allow you to model this conditional parallel behaviour. You can use a combination of XOR and AND gates to create a inclusive gateway. For example, first split with parallel, then for each flow split with XOR.

If the inclusive gateway is an important feature for you, please add a comment to the open issue https://github.com/zeebe-io/zeebe/issues/6018|here

Peter Ihme: What are you trying to achieve? What conditions would you like to put on the edges?

Mohit Mehra: On edges I want to put condition on what type of event it is

Mohit Mehra: Is there any solution for this query?

korthout: what about something like this?

Mohit Mehra: How will this work ?

korthout: Perhaps i don’t fully understand what you like to achieve. The above example is what i think solves the problem i think you have. Perhaps you can explain what you want to achieve in more detail

Mohit Mehra: If I have 4 types of events like A,B,C,D through Kafka and fed to into Zeeebe then all events should be processed by their respective receive tasks

Mohit Mehra: There should not be dependency on one and another that they should not be tightly coupled <@UUUKGMW1M>

Mohit Mehra: And there should be only one instance of workflow to Handel this

Peter Ihme: Sounds like a good place to use an event based gateway: https://docs.camunda.io/docs/reference/bpmn-workflows/event-based-gateways/event-based-gateways/

Mohit Mehra: No we can not because we need all to happen not one of those to happen…All are mandatory event

Peter Ihme: In that case you need a parallel gateway on both ends

Peter Ihme: Each message catch event opens a subspritions that waits for one of the events. As soon as all have arrived, the workflow will proceed

Mohit Mehra: In case of parallel gateway control will go to all the steps would it wait for every event to co relate and then proceed

Peter Ihme: Yes, each catch event waits for the message you specify in the workflow description

Note: This post was generated by Slack Archivist from a conversation in the Zeebe Slack, a source of valuable discussions on Zeebe (get an invite). Someone in the Slack thought this was worth sharing!

If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs.