In this article, I’d be discussing about the creating SharePoint 2010 workflows using SharePoint Designer 2010. Rather than designing a workflow from scratch, I’d be re-using the workflow defined in Visio (Refer previous article).
Before getting into the workflow, I’m defining a content type by name ‘Invoice Report’ with three basic site-columns InvoiceAmount, Invoice Date and InvoiceDepartment to keep it simple.
Create a new custom list by name ‘Invoice’ and attach the content type ‘InvoiceReport’ to it.
Navigate to Site Objects –> Workflow in SharePoint Designer
Choose ‘invoice processing.wvi’ (workflow designed in the previous article) and click Next.
Choose ‘Reusable workflow’ as type of workflow (in this case i want this workflow to be re—used across lists that has associated invoice report content-type).
The workflow will look like the following in the designer.
Go to step ‘Log for starting’ and change the message to ‘workflow is starting’’.
Go to If statement under step ‘Invoice > 50K’ and define the expression like if Invoice Amount less than or equal to 50,000.
Set Workflow status to Approved under If loop.
Under log for Auto Approval, set the message ‘Workflow is Auto Approved’.
Go the Else part and configure the Task Approval process.
In this case, the Task Approval process will be executed if the invoice amount is greater than 50,000. The idea is to enforce a manual task approval process, approved by the manager.
The workflow design would look like the following:-
If you choose Custom Approval Process or Custom Task Process, you’ll get bunch of actions to customize the behavior of the single task or task process.
The Task Behavior Actions is one of the improved feature in SharePoint 2010 workflows. The Task behavior actions does not appear in Visio 2010, when you design workflows . It is available in SP Designer 2010 and VS 2010. The actions like Escalate Task may find a common usage. But in this case, I’m not customizing any task behavior, just sticking with the task behavior defined for the Approval Process in SP Designer 2010.
Check for errors and publish the workflow.
Go to the SharePoint site and associate the Invoice Processing workflow with the invoice list.
Under workflow settings –> Add a workflow
Set content type to ‘Invoice Report’
Select ‘invoice processing’ under the workflow template
Set ‘Department Invoice workflow’ for the unique name of the workflow.
Set the workflow to be started manually
Create an invoice item in the list.
Start the workflow manually.
The invoice item would be approved, because the amount is less than 50K.
Let’s try with another invoice amount of 60, 000.
Start the workflow again.
Now the workflow is not auto-approved, task is assigned to the Manager and it is in progress state.
Log in as Manager to see the assigned Task.
Click ‘Approval’ button to approve the invoice.
We’ve created a very simple workflow in SharePoint Designer 2010. I’ll deal with more advanced workflow scenarios in the next articles.
Subscribe to my post
I thought of writing a series of articles around SharePoint 2010 workflows. This is one of my favourite area in SharePoint 2010 and I’m also involved in lot of SharePoint 2010 workflow development these days. Microsoft Visio 2010 Premium edition has the ability to design SharePoint 2010 workflows using the visual designer and export it to SharePoint Designer 2010 (and then to Visual Studio 2010) for further implementation. This brings powerful workflow modelleing capability to the business users and also brings consistency during workflow modeling and workflow implementation.
The business users/power users can start modeling the business process in Visio 2010 and then transition this to the development team for further implementation. The workflow modeling in Visio 2010 needs a bit of understanding of SharePoint 2010 platform. At this point of time, the SharePoint 2010 workflow modeling capability is not supported in Professional edition of Visio 2010.
Let’s open the Visio 2010
File —-> New —> Microsoft SharePoint Workflow —> Click ‘Create’
We’ll get to see three tabs SharePoint Workflow Actions, SharePoint Workflow Conditions and SharePoint Workflow Terminators.
SharePoint workflow terminators has the activities for start and terminate of workflow.
SharePoint workflow conditions has the set of activities to perform various conditonal checks like comparing against arbitrary parameters, comparing with the current list items and check for other SharePoint related objects.
SharePoint workflow actions has the whole lot of actions that can be performed related to a SharePoint workflow.
If we do quick tour of activities present in Visio 2010, we feel most of these are available in SharePoint Designer 2010. Yes, SharePoint Designer 2010 and Visual Studio 2010 has lot many activities. I’ll brief the in later sections of that article. Let’s move on the the business process, that we want to model in Visio 2010. It’s a simple one. Let’s assume that we’re modeling an Invoice process for a contracting form. The contracting firm (vendor) submits invoice to the company ‘A”. If the invoice is less than 50K, the invoice would be approved. A manual approval process is needed if the invoice exceeds 50k.
Let’s try to model this..
1. Drag the ‘Start’ activity from the workflow terminators
2. Drag ‘Log to History’ from Workflow Actions and connect with the ‘Start’ activity. Double click the activity and name it as ‘Log for starting’
3. Drag ‘Compare Data Source’ activity from workflow conditions and connect it with ‘’Log to History’ activity. Double click and rename the activity as ‘If invoice > 50k’
4. Drag ‘Set Workflow status activity’ . Connect it with the compare data source activity (‘invoice > 50k’). Double click and rename the activity as ‘Auto Approval’. Right click on the connector line and set it as ‘Yes’.
5. Drag ‘Start approval process activity’ to the other side of the compare data source activity (‘invoice > 50k’) and connect it. Double click and name it as ‘Manager approval process’. Right click on the connector and set it as ‘No’
6. Drag a ‘Log to History’ next to ‘Auto Approval’ and double click and name it as ‘Log for Auto approval’. Connect it with Terminate activity.
Navigate to the Process Tab in the Ribbon and click ‘Export’
Save the workflow definition as ‘invoice processing.vwi’.
Now the workflow is ready for implementation in Microsoft SharePoint Designer 2010.
We’ve included the manual ‘Approval Process’ if the invoice > 50 K . This involves task process. The task behavior cannot be customized in Visio 2010 to include more custom task behavior actions like Wait for Change in Task Process, Wait for Deletion in Task Item Process and Escalate Task etc. This can be customized
I’ll discuss about implementing this workflow in SharePoint Designer 2010 in the next article.
Subscribe to my post