I have the following flow where an activity is started asynchronously by executing a REST-API method and subsequently waiting for a certain kafka event to occur that indicates the activity was completed.
This gives an warning “Incoming flows do not join” on the completed event listener step. Normally one would join the flows using a parallel gateway but as the event gateway expects an exclusive gateway but I cannot put that in between the event gateway and the completed listener.
I thought about routing it back and put the exclusive gateway before the event gateway but that might trigger the timer again (which is not desired as the reminder should only be sent once). Of course I could keep track in some process instance variable if the timer was already executed and check that in the flow but that seems a very cumbersome way to do it.
Any ideas how to do this nicely or should I simple ignore the "“Incoming flows do not join” warning in this case ?
A model similar to the one below should meet your requirements. You can use the Result variable from the output mapping of the Kafka intermediate catch event to determine whether the event was received, and based on that, decide whether to send a reminder.
@GotnOGuts’s suggestion is pretty good because it really clearly indicates the happy path but might confuse some readers new to BPMN since it has both a non-interrupting boundary event AND a sub process.
One of the really nice things about this option is that i can be compressed further if you want to hid the kafka stuff and it won’t take away from exectuion.
I also decided to create a combination of both patterns. This uses a terminate event to end the sub process as soon as the message from Kafka arrives.