Saturday, April 21, 2007

Resuming Errored Instances of Bad Workflow Process Design

When you have an error in your workflow Siebel should toss the instance into Workflow Instance Admin. Once you diagnose, fix, and test, you will need to recover all the errored processes. However, you cannot do this via the GUI admin in Site Map -> Administration - Business Processes -> Workflow Instance Admin. Once the revised WF Process is deployed, the saved and errored instances will still be hung on the old and errored Definition. You have to update the Definition Id so that WFProcMgr will use the newly defined WF Process rather than the old.

This problem happened to me when a client wanted to send emails to two different recipient groups. Obviously the smart thing to do was to create an addtional correspondence template and add the name of the template to the Package List parameter of my CreateRequest step on my workflow. Unfortunately I delimited the template names with a comma (',') rather than a semi-colon (';'). With a comma, WFProcMgr sees only one template name instead of two and throws HUGE fits ( a.k.a. errors). Finding my mistake, I needed to recover. I deployed the repaired and updated WF Process definition and then had to update the errored instance as below:

UPDATE S_WFA_INSTANCE set DEFINITION_ID = '1-16C9P' WHERE DEFINITION_ID = '1-163A6'

Once I ran the SQL, I then went throw each instance and resumed Current Step in the Related Instances Applet.

If you ever have to recover and in the process update a WF Process Definition, this advice will be of tremendous help.