Creating workflows for SharePoint 2010 with Office Visio 2010

Microsoft has improved the new version of Visio. With the new version of Visio you can create workflows for SharePoint 2010. In my opinion it’s a great feature, because it’s now possible to split the process of creating workflows. People of speciality departments with no technical background can model their business processes with Visio. Workfows which they created can be exported to a specific file format, which can be imported by Microsoft SharePoint Designer. So, software designers or people with technical background can configure the workflow with business logic and can publish the workflow to SharePoint.

Now I would like to explain the new Visio features more detailed. Opening Visio the first time, you will see that Visio 2010 comes with a new template – Microsoft SharePoint Workflow.

Microsoft SharePoint Workflow

This template offers quite new shapes for SharePoint workflows, which are separated into the following groups:

  • SharePoint Workflow Actions

SharePoint Workflow Actions

  • SharePoint Workflow Conditions

SharePoint Workflow Conditions

  • SharePoint Workflow Terminators

SharePoint Workflow Terminators

I started to design my first Visio workflow, which is a simple request for leave. The shapes can be inserted quite easy – just drag and drop it to the page. After connecting the shapes my workflow seems to be finished.

Request for leave workflow

Before exporting the workflow to the Visio Workflows Interchange file, you have to check the diagram. If any error occurs, it’s not possible to export the diagram.

Visio Ribbon

In my case I used custom conditions twice (as you can see in the diagram). Unfortunately, check process was not successful. It seems that the check process did not recognize the custom condition shapes. Therefore the other shapes are not connected to the workflow.

Issue Window

I also tried to ignore the rule, but nevertheless the diagram could not be exported. I hope that this is just a bug of the Technical Preview and will be solved in the next version of Visio.

So, I will explain the generated Visio Workflows Interchange file with another example. I just created a simple diagram with two shapes.

Microsoft SharePoint Workflow 2

Yehh – that validation worked. So I exported the vwi file. That file contains different files, which can be viewed by changing the extension to *.zip. The following files are created:

  • [Content_Types]
    This file summarizes the used extension and their content type.

Content_Types

  • Workflow.vdx
    is the Visio diagram in xml-format. Actually it’s not that interesting; it’s just a long file defining the Visio layout (and data) in xml.

vwi

  • Workflow.xoml
    The xoml file describes the workflow itself. If you familiar with SharePoint Designer 2007 workflows you will know the structure of the file – it’s similar to that.

xoml

  • Workflow.xoml.rules
    That file simply references the xml namespace.
    <RuleDefinitions xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/workflow” />

Importing vwi-file to SharePoint Designer 2010

First of all, the new SharePoint Designer 2010 looks very cool and Microsoft improved a lot of things. It’s now possible to administrate the whole SharePoint site with that designer. You can configure page information, create and modify lists, document libraries, subsites, permissions, content types, workflows, … .

The following picture shows the start page when you connect to an existing SharePoint 2010 site.

SharePoint Designer 2010

Clicking on the workflow section opens the workflow tool pane, where you can edit existing workflows or add new ones.

Workflow Section

The best innovation in my opinion is that you can now create reusable workflows with the designer. This was not possible with the previous version of SharePoint (Designer). In 2007 you had to create reusable workflows with Visual Studio.

The easiest way to continue with you Visio workflow is just to import it from Visio by clicking the button in the ribbon menu. The import wizard offers you the possibility either to import the workflow for lists or to create a reusable workflow.

Import Wizard

As you can see in the next image, the Designer creates the structure of the workflow. You can now go on with adding the logic to the workflow. The actions are similar to the actions in SharePoint Designer 2007.

Workflow Editing

You can start editing the actions, add new steps and actions and at the end publish the workflow to your SharePoint environment.

Before exporting the workflow to SharePoint it’s recommended to check for errors. If any error occurs the position is highlighted.