Wednesday, October 13, 2010

Creating a simple workflow using SharePoint Designer 2010

Scenario:

Create a list in which I can enter information about an item which was found unoccupied in the campus. Employees can claim the lost item using a workflow. The workflow is considered closed when front-desk verifies the information about the claimant and the item itself and returns the item back to the employee.

At high level this is how it would work:

1. Front Desk (office administration department) enters information about the item found in SharePoint

2. Let’s assume that employees would have subscribed an email alert to this list so that they receive an email whenever a new item is added to this list. (Alternatively, we can have SharePoint send an email to a distribution list whenever a new item is added to the list)

3. Person who lost the item can click on the item and Select “Claim Item” button from the toolbar

Here are the steps to implement such functionality using Sharepoint 2010 List and a simple workflow created using Sharepoint Designer 2010:

1. Create a new content type called “Lost Item”. I will add following Site Columns to it:

a. Name

b. Date Found

c. Contact Person (Someone at front desk)

d. Description

2. Create a New list called Lost Items and enable content type on the list

3. Associate “Lost Item” content type to the “Lost Items” List

I have done all these using Sharepoint Designer as it is much quicker to do with SPD than the browser base interface!

Our Next task is to create a Reusable Workflow using SPD to facilitate the process. And we will attach this reusable workflow to our “Lost Item” content type.

clip_image001

The name of the workflow would be “Claim Lost Item”

clip_image002

When you click Ok, the wonderful Workflow Designer would open up and it would look like this:

clip_image004

Now, when someone claims the lost item, for verification purpose we may want to capture a few things like:

1. Contact Details

2. Item Identification

3. Lost at (Location)

So that front desk can verify the information and make sure that item is being returned to the right person.

Also note that we can assume that person initiating the workflow is claimant himself and we may already have the information about the user (Login ID, Email ID, Name etc) as part of the user profile imported from Active Directory. For the sake of simplicity, we will capture this information when the workflow is kicked off.

Note that above information shall be captured in a Workflow Initiation form and that form can be a custom .ASPX file or an InfoPath form.

Let’s move on!

Let’s add following initiation parameters using SPD.

clip_image005

Please note that APD will automatically create a basic Info Path form to capture this information and it will associate it with the workflow as shown below:

clip_image007

You can click open the form and make it fancier with InfoPath if you want!

Let’s get to the core business and specify what should actually happen as during the workflow. What we want to do is assign a task to the person who created the “Lost Item” record in the “Lost Items” list. The workflow is then hibernated (SharePoint actually persists it in database) until that task is either accepted or rejected.

The first thing I want to do is send an email to the person who created this item. For simplicity, I am sending email to myself! For that, I have added a Send Email activity while being on the workflow designer surface of SPD.

I want an intelligent email. At minimum, I want the claimant’s information in email and the information about the item as well. I love SPD because it makes it a bridge for me ( I feel that even my 2 year old daughter can do it)!

clip_image009

The next thing I want to do is leverage OOB action which allows me to assign a task and wait for someone to approve/reject the task. In this case, approve means the claimant is legitimate and the item must be returned to the claimant and reject means…. Blah blah.. (let me save some typing here)

I have also associated a column called “Claim Status” which I can modify based on the outcome (approved/rejected) of the task. I also want to include in detailed task description when a new task is assigned to someone. My final configuration looks like:

clip_image011

I have also taken following actions based on the outcome of the task:

clip_image012

And finally, I would verify that there is no error with the workflow configuration (again, SPD is so elegant!) and publish the workflow:

clip_image013

At this point you are ready to associate the workflow to my “Lost Item” content type and once that is done, we can see it in action!

Let’s create a new “Lost Item” and feel the claim process (well, be honest and claim it only if it is your wallet)

clip_image014

Just before starting the workflow, the claimant is presented with an initiation form in which claimant can provide more information about the claim as shown below:

clip_image016

When Start button is clicked, the workflow is put in “In Progress” status and email is sent (assuming that you have configured outgoing emails in your server farm)

Below is an email that I received:

clip_image018

Go ahead and check the tasks, you should see a task assigned to you. The Claim Status would change depending upon your actions on the task (approve/reject).

Last not the least, using SPD you can also add a custom action in the List’s Ribbon to kick off claim process!

Hope this was helpful…

No comments:

Post a Comment