Approach to upgrading custom SharePoint workflows
27 Aug
2009
By
Tommy Lum filed in
Technical in nature5
Comments
Maintainability is important when you are developing M software solutions. it is almost inevitable that there will be minor bugs or new feature requests from users that will require you to make changes to your custom software solution after it is deployed
In production.
Upgrading custom SharePoint workflows can be quite time-consuming. the main reason why upgrading custom SharePoint workflows is difficult comes from the fact that each running workflow instance is serialized and de-serialized to and from the database then
Times during the lifetime of its execution. any changes to the workflow's member variables will break SharePoint's ability to perform the serialization and deserialization on the running workflow instances. this means you can't simply make changes to the Workflow
Assembly and overwrite the existing assembly in production unless the change is trivial enough that it will not affect the serialization/deserialization of the workflow.
Instead of upgrading a custom SharePoint workflow, the recommended approach is actually to create an entirely new workflow to replace the existing workflow. to handle the workflows that are in progress, leave the old version of the workflow in Production
And disable new instances of the old workflow from being instantiated.
Here are the steps to "Upgrade" a custom SharePoint workflow:
- Change the workflow assembly's version number
- Update the workflow assembly version number in the attribute of the workflow element in workflow. xml file and the name attribute so that you can distinguish the new workflow from the old Workflow
- Change the solutionid in your manifest. xml file
- Change the name of The. WSP solution package (I. e. corpsite. workflow. itrequest. WSP to corpsite. workflow. itrequest. v1.1.wsp)
- Deploy the new. WSP solution package
- Run iisreset
- Configure the old version of the workflow to disallow new instances of it from being created by disabling all the start options in the old workflow Association
- Create a new workflow association using the new workflow that was just deployed