Wednesday, January 19, 2011

WF: The most useful event.

Few weeks ago a discovered the WorkflowRuntime.ServicesExceptionNotHandled event. This event can save you a lot of time debugging strange behavior of workflow instances. In my case all instances of a workflow didn't complete after an 'insignificant' change in the workflow class. No exceptions have been thrown by the runtime or the workflow code and the workflow instance just didn't failed or complete. After some 'googling' I came across the ServiceExceptionNotHandled event. So I registered a handler and traced the not handled exception. It turned out that the persistence service has thrown an exception each time it tried to save the workflow state in the database because one member of this workflow was not serializable. Without that event I would still be debugging that workflow :)

No comments: