Tuesday, November 9, 2010

Deploy a workflow as a WSP file (SharePoint Server 2010)

In SharePoint Designer 2010, you can create reusable declarative workflows. That means workflows created in SharePoint designer can now be generic (not tied to a list) and can be moved to other Site collection or sites via .wsp file. The "Save as Template" command can be used to create a WSP file containing a reusable workflow. The workflow can also be moved to Visual Studio 2010 for further Customizations.

Steps to Move Workflow are :

1. Create a SharePoint workflow using SharePoint Designer 2010.

2. After you are done with creating a workflow, Click on "Save as Template" button on Ribbon the bar. This will create a wsp file for you workflow, which will be uploaded in the current site collection itself.

3. Now, Open the Top Level Site or Site collection, in which you created the workflow. Goto View all site content and click on "Site Assets" library. You will see your saved workflow wsp (or soluiotn package) gets upload to this library. However, to deploy it in the site colletcion you will need to download this file and upload into Solution management.

4. To download this wsp you can open up the drop-down menu for this file and Choose Sent To -> Download a Copy.

5. Now to Upload it to Solution management of this or any other site collection goto
Site Actions -> Site Settings -> Under Galleries click on Solution gallery. Then Click on Solution tab(in ribbon bar) and click on Upload Solution and browse to the aboved saved file. Once the solution is uploaded click on "Activate solution" to activate it.

5. Since the workflow is deployed as a feature, you will now activate the workflow feature for the site where you want to use the Workflow. To do this goto Site Settings of that site and click on "Manage Features" now simply activate the workflow to use it in the Site.

Please note that another option in ribbon bar "Converted to be Globally Reusable" will only save your workflow to be globaly reusable. It will not create wsp file to be deployed in another farm. Also, the workflows created at the root level of the site collection can only be converted to be Globally Reusable but other ones created in sub sites cannot. 

No comments:

Post a Comment