Wednesday, 28 August 2013

Workflow in SharePoint 2013

In this article we can explore another core aspect of SharePoint named Workflow.

What is Workflow?

Workflow helps in automating processes. A workflow once started, will go through various states, performing activities. SharePoint consists of several Out-of-the-box workflows that help with:
  • Automating Content Approvals
  • Notification Workflows
  • Disposing Expired Contents
Additionally, SharePoint supports custom workflows to be created using the following tools:
  1. SharePoint Designer
  2. Visual Studio

How Workflow is started?

Workflow can be configured to start:
  1. Automatic
  2. Manually
To enable automatic starting, we have to configure the particular List or Library settings.
To start manually, choose the Site Settings > Workflow Settings option.

What are the new features in SharePoint 2013 Workflows?

SharePoint 2013 brought several new features to workflow like:
  1. Fully Declarative Authoring
  2. REST and Service Bus messaging
  3. Elastic Scalability
  4. Managed Service Reliability
  5. New Workflow Manager Service
[image]
Workflow Manager helps hosting workflows in a multi-tenant environment with high scalability & high density.

Components of Workflow

Following are the components of a Workflow:
  • Workflow which constitutes the core component
  • Workflow Instance which is a running copy of the Workflow
  • Workflow Runtime which is the execution environment
Depending on the workflow the execution might complete within few minutes or multiple days. The state machine workflows will be persisting states between multiple machine restarts.

Workflow Scenario

Now we can try playing with an existing workflow. Here we are trying to use the Tri-state Workflow which is an Out-of-the-box (built-in) workflow.
The workflow helps in keeping track of an item in list or library. For example if you have a Product Review list, where each status of approval should be notified, the Tri-state workflow is a good choice.
[image]
To operate this workflow, you need three Choice column states.
Step 1: Create the List
We need to create a custom list named Product Proposal with following columns:
  1. Name (Text)
  2. Description (Text)
  3. State (Choice)
Site Contents > add an app > Custom List > Enter Name
Step 2: Open List Settings
Open the list by clicking on it from the left pane.
[image]
Click on the List tab and choose List Settings. In the appearing page you can edit the List Columns.
[image]
Step 3: Create Columns
Click on the Create column link as shown above. In the appearing page enter column name as Name. Choose the type as Single Line of Text and click the OK button.
[image]
Repeat the step for Description column as Multiple lines of text.
For the third column named State set the column type as Choice.
[image]
Enter the choice values as Proposed, Approved, Produced.
Step 4: Add Workflow
After all columns are created, choose the LIST tab > Workflow Settings
[image]
In the appearing page click on the Add a workflow link.
[image]
Choose the Three-state workflow, enter a name, check the option to start when item is created.
[image]
Click the Next button to continue.
In the appearing page choose the Workflow State fields. (Automatically set)
[image]
In the below section enter the Email Message, Approver Email etc.
[image]
Click the OK button to save changes.
Step 5: Test the Workflow
Now we are ready to test the workflow. Please go back to the Product Proposal list & create an item.
You can see that within 5 minutes an email is received at the first email specified. When the product is approved (second state) another email is sent to the second email specified.

References

MSDN on Workflows http://bit.ly/VpK4ax
Workflow Manager http://bit.ly/SZfeOA

Summary

In this article we have explored SharePoint Workflows. In real world scenarios workflows helps in automating tasks & saving productivity hours.

No comments:

Post a Comment