Parallel Activities in Approval WorkFlow in SharePoint 2010, Correlation Token in Multiple Task


In this blog I gathered some similar feature of sharepoitn 2010 which are coming frequently in developing the composite approval workflows in the SharePoint 2010. My WorkFlow start Whenver the user requests for vacation by adding an new item or change item in the list, then workflow creates two Task One for Team Leadr to approve, and another is Department head to Approve, for each approver workflow creates a new task to complete , once the task complete by both the Approvers, WorkFlow Complete it state otherwise keep in pending state.
The Content of the workflow are mentioned below.
I have used a very simpel custom list name Vacation Request.

Vacation Custom List
Vacation Custom List

Create a Empty SharePoint Project, Add Sequential Workflow ,

SequentialWorkFlowIteminEmptySpProject
SequentialWorkFlowIteminEmptySpProject


Deploye as a Farm based soluton , Associate Workflow with mentioned Vacation List (Custom List).
Associate with Custom List Enable Task and WorkFlow history List
Associate with Custom List Enable Task and WorkFlow history List

(1) Creating two Task & assign them to the Users,
(2) Using Same Task Id (i.e. Same Correlation Token for Both the Parallel Task)
(3) Put while loop to check the task status
(4) Complete the Task whenever the While loop ends.

WorkFlow is something like that.

Sequantai lWorkFlow Starting
Sequantai lWorkFlow Starting

WorkFlowend Paralle and while activity in the workflow
WorkFlowend Paralle and while activity in the workflow


Here is the code behind of assigning Tasks to users.
AssigningTask to user mentioned nithe list
AssigningTask to user mentioned nithe list


I declared two Boolean Flags which provides the current status of each task. In the While loop I Added
a OnTaskChange Event , Whenver the Task Change or Edit this event Occurs and Check the Stauts of the Task, If It is complete then Flag become false and ends the While Loop.
Checking the condition in the while loop
Checking the condition in the while loop
.

In the end there is TaskComplete activity which indicate task has complete and go to the further step in the workflow.

Download Lab here : Download Visual Stduio Project
Note : based Classis autentication for user authorization and authenticaiton.
Interesting Feature : We can debugh Workflow by multple ways, with vs2010, by log in the history list of each individual step and every single propery

Advertisements

2 thoughts on “Parallel Activities in Approval WorkFlow in SharePoint 2010, Correlation Token in Multiple Task

  1. Pingback: My Homepage

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s