What is Workflow?
Workflow started as a component of the .Net Framework 3.0 named Windows Workflow Foundation. Workflow represents a sequence of activities as in a Flow Chart and a runtime that executes these activities.
The Workflow activities are executed inside a:
- Windows Application
- SharePoint Server
- ASP.NET Application
Workflow is integrated into SharePoint 2010. We can create Workflows using the SharePoint Designer, Viso and Visual Studio.
Why we need Workflow?
Workflow provides a convenient way to automate manual business processes.
The activities in the Workflow can be represented in a graphical manner and adds great flexibility to a developer and non-developer. Using Workflow we can easily achieve the branching, cases and executions in an easier manner.
Inside SharePoint, the Workflow feature enables an easier way of associating activities; Approvals, Rejections, Copying, Moving, Email Notifications with Document Libraries and Lists.
Scenario to reveal the advantage of Workflow:
From the above scenario we can understand the cost and time savings using Workflows. It allows dragging and dropping the common programming scenarios. We can also do advanced activities by programming extensions of Workflows.
Common Workflow Scenario
We can apply a Workflow for the following scenarios.
Scenario 1: A task list allows creation of a task for users. Whenever a new task is created in the list, we need to notify the user associated with it. We can use a Workflow to accomplish this easily.
Scenario 2: A company consists of developers with various skill sets. There is a set of Training Items. Each developer can apply for the training. The application will be notified to the Training Manager. He can check the skill set and approve or reject the applicant. If selected, the applicant can attend the training. On completion of training there is a verification exam to be undergone by the attendee. If he passes then the Certificate is issued else the notification through email is done. We can use Workflow to accomplish this easily.
Scenario 3: People upload their expense reports into a Document Library. The library captures the expense as a separate field. Every week manager has to change status to Approved for the expenses with less than $500. The list contains hundreds of entries. The status updates can be done using Workflow in just 1 minute.
Scenario 4: The client can create a bug and the developer should be notified by email. The developer, on completion of the bug fix, changes the status and the client is notified. This whole process can be done through Workflow in an easier manner.
The above scenarios shows that a good amount of programming effort is needed to provide a solution. Using Workflow with SharePoint we can reduce the effort considerably.
When the activities become complicated in the business world, Workflow provides a graphical and modular approach in addressing them simply.
Reusable and Non-Reusable Workflows
In the case of SharePoint 2007 the workflow created for one list cannot be used for another list. But in SharePoint 2010 the same workflow can be applied for multiple lists and thus is reusable. We can create reusable workflows using SharePoint Designer 2010.
There is a similar term called Globally Reusable Workflow which requires conversion of an existing Reusable Workflow. Once it is converted the Workflow can be used with the whole site collection.
We can export the workflow as a template to be used with another site collection. We can also import the WSP (Windows SharePoint Solution) file inside Visual Studio using the Import Reusable Workflow wizard.
Manual and Automatic Invocation of Workflow
We need to mention that there are 2 ways of starting a Workflow:
In the case of manual start, the user / administrator has to click some buttons for the workflow to start.
In the case of automatic start the workflow executes automatically. This can be configured along with a list/library like:
- Start on Creation of Item
- Start on Updation of Item
A typical Workflow usage in SharePoint is:
- Developer creates the Workflow
- Administrator deploys the Workflow
- Site Users use the Workflow
Designer, Visio and Visual Studio
The SharePoint Designer provides an easier way for Administrators and Developers to create Workflows. Along with Microsoft Visio, Designer provides much more flexibility and features in Workflow creation.
Using Visual Studio, developers can write more complex programming tasks with Workflow. Using the SharePoint extensions for Visual Studio, the builtin templates provides easier Workflow creation and deployment.
In this article we have explored the Workflow feature of SharePoint 2010. In the next article we can experiment with creating Workflows.