Friday, February 25, 2011

Changes to SPD Workflow not reflected in MOSS 2007

On more than one occasion, I and my team have faced a problem where my updates to SPD workflow were not getting applied, and older version of workflow kept running. This usually occurred where the workflow had become large with multiple steps, and manually recreating each and every step would have been painful.

To resolve, we had to:
1.     Create new workflow on the same list
2.     Add dummy if condition to generate xoml.rules file in the new workflow
3.     Copy paste the steps and rules from existing workflow to new workflow by opening the files in notepad
4.     Publish new workflow, Disassociate the existing workflows and Associate the new workflow
5.     Post validation that things are working as expected, rename existing workflow to Workflow_Corrupted or Workflow_Old to clearly identify the same in future.

The solution is also described in another blog here, difference being my preference to rename instead of delete the existing workflow.
http://samar-hossam-sharepoint-spot.blogspot.com/2008/12/spd-workflow-changes-performed-in.html 

Like Samar, what I really want to know is the root cause of what causes the workflow to get corrupted?

My colleague Rajdeep Chakraborthy suggests it’s a Caching issue. It’s a hosted server, and we don’t have access to server to do IIS reset and immediately validate. I am ruling out XML Well Formedness as we are copy pasting existing xml and it works. Wondering what else can cause the issue?

Update:
Rajdeep found a simpler solution. Detaach existing workflfow, do required changes, and attach it again to the list.
“Go to List Settings > Workflow settings > Remove a workflow > Select Remove option from the radio button and click OK. Then open the workflow again from SharePoint designer, make some changes and click Finish, so it is associated again.
Your changes should now appear”
The problem is likely to occur if there are running instances of previous version of the workflow. I did not have any pause/delay activity and ideally, all my workflows should have run to completion.

1 comment:

Anonymous said...

Found this worked very well to resolve this error (at least for me): http://sarpoint.wordpress.com/2012/04/24/spd-workflow-changes-done-to-the-workflow-are-not-reflected-on-the-site/#comment-24

In a nut shell, clear out the webCache on your machine.