Thursday, June 2, 2011

How to create workflow using Visio and SharePoint designer in SharePoint 2010?

In this post we will discuss how to create workflow using Visio and SharePoint designer in SharePoint 2010?

Also you can check out:

- Sequential vs State machine workflows in SharePoint 2010

- Add script reference dynamically through code in SharePoint

- Enable Anonymous Access in SharePoint 2010

In SharePoint 2010 we can create a workflow using Visio and later we can import that workflow in SharePoint designer 2010. Visio has a new template to work with SharePoint 2010 namely Microsoft SharePoint Workflow. You can use this template to design the workflow and later we can import that workflow to SharePoint designer 2010 or to Visual Studio 2010. There is no special thing to do to design the workflow rather simply drag and drop from that template only. Some tips to precede:

Go to Microsoft Office then select Microsoft Visio 2010. Then from the Template Categories Select  Flowchart and then from list of flowchart template Select Microsoft SharePoint Workflow template as shown in the figure below.

Then choose different steps from the list of shapes available in the left side as shown in the figure. You can select Actions, Conditions, and Terminators from the list.

After you have designed the workflow, it is now ready to export to SharePoint designer. Then either you can save the workflow or it will automatically save the workflow when you export the workflow. But it is better to check the workflow diagram before export it. To do so go to the Process Tab in the Visio then click on Check Diagram as shown in the figure.

Now click on export, it will ask you the Save dialog box if your workflow passes the validity test. The format will be .vwi. This is nothing but a .zip file, even you can change the extension to .zip and see the contents.

In these steps all are Visio work finished now we will have to open SharePoint designer 2010 to import the workflow.
In the next step Open SharePoint designer and connect to a site in the development environment. In the left navigation pane, under the Site Object category, click Workflow. On the Ribbon, click the Import From Visio button. The Import Workflow From Visio Drawing dialog will prompt you to locate the file that you want to import and then click Next. The last screen prompts you to name your new workflow and select a type of workflow to create. Choose the option and click on finish.

After you import workflow, it will open the workflow designer and give options to refine the workflow and configure actions.

In the next blog I will go details about the modifications in SharePoint designer.

Deploying the SharePoint Designer workflow:
Click the Workflows item under Site Objects in the left navigation pane then Click to the right side of the name of the workflow that we just created to select it, and then click the Save As Template button on the Ribbon. Then it will save in the Site Assets library. In the site assets there is nothing the wsp file, which can be downloaded and deployed as described here.