I’m using the SDL Tridion event system to fire a method (OnEmergencyRelease) once a Workflow Activity has been completed. However my method isn’t being entered during testing, where I’m stepping some components through the workflow process.
I’m subscribing using the following code:
EventSystem.Subscribe<Component,
FinishProcessEventArgs>(OnEmergencyRelease, EventPhases.TransactionCommitted);
But OnEmergency is never being entered:
private void OnEmergencyRelease(Component component,
FinishProcessEventArgs args, EventPhases phase)
{
_log.Info("Emergency release entered");
}
Anyone have any ideas what I’m doing wrong here?
I know the event system is being picked up as I write to the log in the constructor of my class.
I can’t tell you for sure what happens, but I suspect that the FinishProcessEventArgs is not called on the Component object itself. Maybe you should try intercept on an object ‘higher up’ in the class hierarchy.
Example: use Process (or ProcessInstance or even IdentifiableObject)
EventSystem.Subscribe<Process, FinishProcessEventArgs>(OnEmergencyRelease, EventPhases.TransactionCommitted);