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.
Create a Empty SharePoint Project, Add Sequential Workflow ,
Deploye as a Farm based soluton , Associate Workflow with mentioned Vacation List (Custom 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.
Here is the code behind of assigning Tasks to users.
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.
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