Friday, January 30, 2015

Saving SPD workflows along with Site Templates

If you have a SharePoint designer workflow attached to a list in a SP site, and you want to create an identical site, you will save site as site template and create a new site with it, assuming it will be identical.



In reality this is not the case, as any SPD list workflow will not work in new site, as they will still be associated with List Id's ( for list with which workflow is associated, Task list & History list) in original site.



To make this work, recreate SPD list workflow as reusable workflow, attach it to required list and then save site as site template. Now, if you create new site based on site template, you will find workflow associated with list and working as desired.



Reason: As earlier stated, with regular workflows, List Id's are bonded strongly in workflow.xoml.wfconfig.xml , where as with reusable workflows, List Id's are loosely bonded, to be more clear following association entry will show the difference:



reusable workflows:

< Association ListID="{$ListId:Lists/Contacts;}" StartManually="true" TaskListID="{$ListId:Lists/Tasks;}" HistoryListID="{$ListId:Lists/Workflow History;}" StartOnCreate="true" StartOnChange="true" />



regular workflow:

<Association ListID="{5112D71E-2D5A-4875-9ED8-E7DD78D3D901}" StartManually="true" TaskListID="{49170964-7E29-4902-A8E2-888D3C882AC9}" HistoryListID="{74CFBD22-9D23-46E2-B342-993025AFCE9B}" StartOnCreate="true" StartOnChange="true"/>




by Deepak Chawla via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment