Enforcing a sequence for processing related Business Events

Is there a way to enforce ordering with Events?

For example, consider two events x and y where y must not be delivered to targets until x has successfully delivered to targets. If event x has a target where the Target Delivery Status = Error or some other issue stopping the event from being fully processed, is there a mechanism for making y stand by and only start the process of delivering to targets once the issue with x has been resolved?

As far as I know, no - once an event definition and rule pick up a change in the system and attempt to process that change, there is no wait condition. There is currently no sequential execution key or similar ability that would guarantee y is delivered only once x succeeds.

It would be possible to accomplish this in two ways, one likely more relevant than the other:

  1. Configure event x with a logic block target that causes event y once it commits. This would mean that y could be a user-defined event or a workflow change and the original logic within x updates a record or queues a workflow transition to set off y only once complete.
  2. (less ideal for most scenarios) Implement a validation or wait condition within the logic block target of event y that either verifies x has completed its processing (erroring if not) or uses a while loop to wait until x has completed, breaking out of the loop on failure.

#2 is risky because it presents the ability to get stuck in an infinite loop or simply drain server resources while it waits. Using two event definitions might not even be right for this case, and whatever processing y must accomplish could be directly linked to event x or triggered via workflow transition, background task queue, etc.

1 Like