2
votes

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.

2
What process are you attaching to? Do you know if your pdb files are in the correct place? - Chris Summers

2 Answers

6
votes

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);

0
votes

Is the event firing? I would expect Finish Process events to fire when you explicitly invoke a finish process action, and probably not when you step the items through.