Event State multiple event handling #512
-
In the Event State, it is supposed to wait for All events (or expected events) to be received before transitioning to the next state. What happens when i receive multiple of the same event? E.g in your example, what happens if the state receives multiple Event B? How do i handle this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Another good question, thank you.
This depends on the "exclusive" param set on the event state (see docs).
If you have a workflow definition which has a starting event state that waits for event B, without looking at event correlation at this time, each consume of event B should trigger a new instance of that workflow. So let's say that you have workflow def that waits for "Customer" event with event correlation set on "customerId". When you get the event, runtime should check if any running workflow instance exists that is waiting on this event with that correlation to customerId (for example a non-starting event state that waits for Customer event with that correlation). If it exists that event should be delivered to that instance and not start new workflow execution. If none exist then the workflow def that waits for just event B can be invoked. Hope this helps some. The event state def should give enough info for runtimes to be able to determine what to do. If you feel that this is not currently the case, feel free to give suggestions. |
Beta Was this translation helpful? Give feedback.
Another good question, thank you.
This depends on the "exclusive" param set on the event state (see docs).
If you have a workflow definition which has a starting event state that waits for event B, without looking at event correlation at this time, each consume of event B should trigger a new instance of that workflow.
If event correlation is considered (see docs on how to define correlation on event definitions)
then the runtime must be able to use this corr…