Documentation Center

Event subscription order

To ensure that Event Handlers are triggered in the order in which you want them to be triggered, you can specify the priority of the current Event Handler by setting the order parameter in your call to Subscribe or SubscribeAsync.

If you create multiple Event Handlers, the same event may trigger two or more of those Event Handlers. For example, if you write one Event Handler that triggers just before any content item undergoes a BluePrint-related operation, and another Event Handler that triggers just before a Component is Unlocalized, then unlocalizing a Component triggers both Event Handlers.

In some cases, the order in which the Content Manager executes these Event Handlers may be important. For example, one Event Handler may remove (part of) the content item that the other Event Handler might expect to find.

To ensure that Event Handlers are triggered in the order in which you want them to be triggered, you can optionally specify the priority of the current Event Handler by setting the order parameter in your call to Subscribe or SubscribeAsync:

  • Early
  • Normal (the default value)
  • Late

The Event System executes the various Event Handlers by applying the following rules:

  • It executes any Event Handler with order set to Early before any Event Handlers with order set to Normal or Late.
  • It executes any Event Handler with order set to Late after any Event Handlers with priority Early or Normal.
  • If there are two or more Event Handlers with the same priority (all Early, all Normal or all Late), the order in which they execute is the order in which the Event Handler assemblies are listed in the <extensions> element in the Content Manager configuration file.