Click here to Skip to main content
13,049,814 members (94,334 online)
Click here to Skip to main content
Add your own
alternative version

Stats

9.9K views
3 bookmarked
Posted 17 Oct 2012

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 the same as OUT of Box SharePoint approval workflow which allows multiple users to approve the document and when everyone approves the document, the document moves to the next state which is approved.

All the articles pointed to 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 the Microsoft site which is a basic state machine workflow. Here is the link.

Modifications to the code are as follows:

  • Added a new state at level 2.
  • In the state initialization, created two tasks with different Correlation token, task ids and task properties.
  • Now added two event driven activity.
  • Kept 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. The 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

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Oct 2012
Article Copyright 2012 by Rohit Shrivastava
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid