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.