This is the second post in the SharePoint 2010 and Visio 2010 - better together series. And it is time to really check out what this great combination have to offer, and the most obvious subject to start with is that we can now use Visio to design the workflows, which then are imported to SharePoint via SharePoint Designer 2010. So let’s get started.
If you ever built workflows for previous versions of SharePoint you either used SharePoint Designer 2007 or Visual Studio 2005/2008. SharePoint Designer 2007 had a very limited workflow designer (you can’t actually call it a designer) that took quite some time to get used to and you were very limited in what to do. Visual Studio of course offered you the full set of workflow features. I’m not trying to get to deep into the actual workflow stuff here but it is important to understand how hard it was for the organizations to get their hand-drawn or Visio-drawn workflow into SharePoint. If you used SharePoint Designer to build the workflows then the most problematic situation was when you were supposed to move the workflow from you development environment to production - this was just impossible (yea, there was ways to work around it - but not for mere mortals).
Visio is excellent in drawing flowcharts, workflows and business processes and some business analysts just love it. So very often you were presented with a Visio diagram of a workflow that you were supposed to implement in SharePoint. What did you do then? Yes, you had to translate the workflow into either a SharePoint Designer 2007 workflow, using the wizard or go for the full monty with Visual Studio. There was room for many mistakes in this process of you, the developer or SharePoint professional, interpreting the Visio diagram to a SharePoint workflow.
Now, with SharePoint 2010, SharePoint Designer 2010 and Visio 2010 the story is quite different. You can let your business draw the actual SharePoint workflow using the SharePoint Workflow template in Visio. Then you take this Visio diagram, turn it into a SharePoint Designer acceptable file format and configure the last bits in SharePoint Designer. Once that is done all that is left is to hit the publish button. Once the workflow is in place you can let the original author of the Visio diagram verify the functionality. If it is not what he or she asked for you can export it once again to a Visio drawing and fine tune it. The workflow can go back and forth between Visio and SharePoint via SharePoint Designer until everything is set and done.
Before going into some conclusions and experience from this new way of producing SharePoint workflows, let’s take a look at how you do this.
Assume that we have a list in SharePoint containing proposals that we would like to send to our clients. In this case we use a custom list, but it could be any kind of list or library. Each proposal has a Proposal Value. If the proposal Value is higher than $100.000 then our manager must approve the proposal before sending it to the client.
The financial controller of our organization decides that this must be implemented as a Workflow on a list and fires up Visio 2010. Of course he uses Visio 2010 Premium - which is the edition of Visio that contains the SharePoint Workflow template. Using this template the controller can draw the workflow using the default SharePoint Actions, Conditions and Terminators.
By dragging a Start and End Terminator onto the drawing and then adding a condition (Compare Data Source) which should be used for comparing the proposal value to the limit he starts building the workflow, visually. If the condition is below a certain threshold it automatic set the content approval status and if it is above then it should send an e-mail to the manager and then start an approval process and so on. The actual values are not set here, just the actions and conditions in the workflow.
All this is done by dragging the Actions and Conditions onto the drawing surface and then using the connection tool to connect the items. Notice that the controller cannot set any properties, see Shape Data tool pane, on the actual Workflow Actions. The only thing that can be configured is which path to take for a condition. This is set by right-clicking the connection and then select Yes or No.
The SharePoint Workflow template, as well as other templates in Visio can also be validated. This is done using the Check Diagram button in the Process Ribbon tab. This check makes sure that all actions are connected and that there are no loose ends. It also checks so that the workflow does not contain any loops, which is not allowed in SharePoint Designer workflows.
Once the financial controller is satisfied with his workflow he saves it and sends it to the SharePoint professional, if he isn’t one himself. Here, he can send it as a standard Visio drawing using the .VSD format or he can use the new Visio Workflow Interchange format with the .VWI extension. The downside with sending it as a .VSD file is that the SharePoint professional must open it in Visio and convert it to a VWI file - which is the format that SharePoint Designer 2010 supports. On the other hand, it might be easier to not teach the business about that and avoid confusions?!
To create the VWI file you cannot choose File > Save As. You need to use the Process tab in the Ribbon once again and select the Export button. This pops up an Export Workflow dialog where you can specify path and file name. Also notice the Import button. You use this to import a VWI file created by Visio or exported from SharePoint Designer, if you need to go back and update any changes.
Here it is important to notice that if you export it from SharePoint Designer and then import it into Visio to once again get it back to SharePoint Designer. When exporting an imported VWI file using the same file name you must select to Update workflow information in existing file in the dialog. This makes sure that you can import it to SharePoint Designer once again without losing any settings configured in SharePoint Designer and to allow you to update an existing workflow.
Ok, now you have the VWI file and you have fired up SharePoint Designer on the site containing the Proposals list. Select the Workflows object in the left navigation of SharePoint Designer and choose Import from Visio in the Workflows Ribbon tab. Then choose the workflow interchange file that you just exported. When you have selected the file you will be presented with a dialog that asks you how to import this Workflow. In this case we want it to be a list workflow, so we select the Proposals list and also give it a good name, then click Finish.
SharePoint Designer will now open the workflow in the Workflow editor and you will see a workflow without any configuration - just the “flow” as designed in Visio in another, more logical, representation.
Now you have to discuss with the financial controller what exactly is supposed to be the conditions and values - or even better whish that you got some documentation with the Visio file or even annotations in the actual file. After configuring the workflow it should look like below:
We are almost there. All that is left is to verify the workflow by clicking on the Check for Errors button in the Ribbon menu and then configure the workflow to start whenever an item is added or changed. To edit the start options you use the bread crumb menu in SharePoint Designer and click on the name of the workflow. This takes you to the Workflow page and in the Start Options section check the Start workflow automatically when an item is created and the same for the changed option.
The workflow is done, designed using Visio and configured using SharePoint Designer. Now we need to test it in SharePoint. But first you must publish the workflow. This is also done using the Ribbon menu, click on Publish and wait for the process to finish. SharePoint Designer will also check the workflow for any errors before publishing it. If you don’t want to publish it right now you can select Save and go get a coffee and get back later and publish it.
So now, head on over to the Proposals list and add a new proposal, this time with a proposal value of over $100.000. Notice how a new column is added to the list, with the workflow status, and that it automatically starts when you created an item.
Since this workflow had a Start approval process action a task item will be created in the Tasks list, assigned to the person configured in the workflow using SharePoint Designer. Once the task is done with an approve or reject status the workflow will continue and update the proposal with the outcome, as well as sending an e-mail back to the original person creating the proposal.
Quite easy, isn’t it.
I really like this approach, as a first version of the Visio, SharePoint Designer and SharePoint integration. There are a couple of things that I hope gets addressed in the future. First of all you can’t really put the SharePoint Workflow template in the hands of a business analyst. They are so used to working with regular flow charts or BPMN diagrams. It can sometimes be hard for the to get a good understanding of the different actions in the SharePoint workflow directly related to lists. Secondly it is too bad that you can’t configure more using Visio - as the matter of fact it will be hard having one person designing the workflow in Visio and another configuring it in SharePoint Designer. But we have a lot of things to look forward to in upcoming versions - and it’s a fantastic start!
Next time I will show you how to enhance the workflow experience using Visio Services so that your end-users always knows what is happening to their workflows. Which is one of the features I like most about the Visio and SharePoint marriage.
This post was originally posted on EndUserSharePoint.com at http://www.endusersharepoint.com/2010/09/06/sharepoint-2010-and-visio-2010-better-together-part-2/