Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Create Parallel Task in State Machine Workflow in SharePoint 2010

, 17 Oct 2012
Rate this:
Please Sign up or sign in to vote.
Create Parallel Task in State Machine Workflow in SharePoint 2010.

I faced a problem while creating parallel tasks in state machine workflow. My requirement is same as OUT of Box SharePoint approval workflow which allows multiple users to approve the document and when everyone approves the document, document moves to next state which is approved.

All the articles pointed me that this is possible in sequential workflow.

Here is the thread which explains the problem, I am not going to invest much time to explain the problem http://groups.google.com/group/microsoft.public.sharepoint.portalserver.development/browse_thread/thread/e0beac08110f6135.

I downloaded the code sample available at Microsoft site which is basic state machine workflow. Following is the link. http://code.msdn.microsoft.com/SharePoint-2010-Creating-39ac75ea

Modifications to the code are as follows:

  • Add a new state at level 2.
  • In the state initialization, create two tasks with different Correlation token, task ids and task properties.
  • Now add two event driven activity.
  • Keep flags for each parallel task
  • Added OnTaskChanged event driven activity, On Invoked event updated the associated flag to true.
  • Put an IF block and check if all the flags are true, then set state workflow to next state.

I found this easy to implement, though manual code is involved which should be done via a parallel activity. Code can be downloaded from here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rohit Shrivastava
Architect
India India
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 17 Oct 2012
Article Copyright 2012 by Rohit Shrivastava
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid