Escalation exceptions


Badge +7

Hi

 Can anyone tell me if I need to do anything special to handle exceptions in escalation rules or events?

For instance, in my process properties under "Exceptions" I have defined code to generate an email alert to an administrator. This works fine.

Today we had an issue where an escalation rule threw an exception. It was weird because the rule is to escalate after the date in a process datafield. The date in the datafield was 22/05/2008, and even though today is the 15/05/2008 it threw a "escalation date cannot be smaller than start date".

We never received an email notification about the exception in the escalation rule, as we are accustomed to whenever we get an exception in say a server event. The escalation rule is as generated by K2, there is no error handling there.

Is this behavior normal? Or do we need to do something special to watch for errors in escalations? I ask because the error was weird - as stated above, but what's even weirder is I just clicked "repair error" without changing anything and the problem went away.

Thanks,

 Richard
 


3 replies

Badge +9
That doesn't sound normal.  The only cases that might have occurred is when the date datafield got changed by someone or if the server timing got changed by someone.  However, it might be a bit hard to trace as the repair error worked (which indicates the cause has now disappeared).  Continue monitoring the situation and see if this occurs again.  It might be also worthwhile to check the security logs to see if anybody has been changing settings on the servers.
Badge +2

I've had exactly the same exact situation. I have a generic error handling logic but an error occured in the escalation rule. The strange thing is that I've expected the escalation to run again after the specified escalation time but it didn't happend. Also no email was sent from the generic handling logic which means that it didn't go to that code at all.  I've checked the K2 error log and found this:


"WorkActivity","5016","CodeItemExceptionHandled","ProcessInstance::ExecuteCode","5016 Handled Exception in Code Item EscalationAction - Escalation1


Note that the bolded code is not one that I have in my process definition.


I think that K2 is handling the error in the escalation with some custom exception handling and is not propagating the error to the process level exception block.


 I've fixed that by putting an try/catch where I call GoToActivity({Escalation Activity Name}) so I can trigger the escallation to run again. In my case it works but I guess if the logic in the escalation activity is much more complex than mine this will be not that simple. I think that even just catching the error will do the same trick since the escalation will trigger the next time, but I want at least to have it in the process state history.

Badge +7

Interesting.

 I just did a quick test,  in the Main method of the escalation rule:

- If I throw an exception (throw new Exception()) before or after setting the escalation rule, I get an email from the process level exception handler

- If I set the escalation rule with a bad value like this:

     DateTime DateTime = new DateTime(1999,12,31,0,0,0);
    K2.SetEscalationRule(DateTime);

 K2 still handles the error (it comes up in Service manager and can be repaired) but the process level exception handler does not appear to run (no email is sent).

So it would seem you are correct - the SetEscalationRule method is behaving differently.

Thanks, Richard

Reply