Dynamic Sharepoint Workflows: How to
// November 18th, 2009 // Uncategorized
Ive been itching to write this blog post for a while. See ive been holed up a major car company for a little while now who had a basic requirement. They have MOSS 2007 and were wanting a basic Infopath form and multi-step approval workflow behind it, which just did the basics like sent emails and reminders such as “please approve/reject this form” or “please review this form”. In 95% of Sharepoint Workflow articles (the State machine workflows) ive found that Sharepoint Experts create multiple tasks, with multiple correlation tokens etc etc and it all seemed just a little too confusing and long winded. Now im sure its best practice to create workflows in this manner, but is it easiest? Better yet, is it DYNAMIC? How do i redeploy this workflow for another client and update it without any code changes?
Far too often ive spent time sitting at clients creating each one a custom workflow for their needs, then deploying and moving on, only to find a similar requirement next week at another client. I can write Visual Studio State Machine and Sequential Workflows all day, but surely there is a way to reuse what ive done, better yet, deploy one workflow, and tweak it outside of Visual Studio (without code manipulation) Was there essentially a way for a Business User to update their own workflows?
Well immediately Products such as Blackpoint, Agilepoint or Nintex came running through my mind. They all give the user the ability to create their own workflows, just a little training on those, and id never have to write another workflow. However, most of my clients cannot afford these wonderful products. So they were a no go. Still i was convinced there was a way to create the dynamic workflow!
Well heres my answer:
Essentially every workflow is state based really, it moves from state to state, whether it be sequential or not. A simple example would be a travel request:
State 1: User fills in form -> State 2: send to manager -> State 3: Manager reviews -> State 4: Form approved/rejected.
Within a state machine workflow, the workflow may respond to an event such as OnWorkflowItemChanged and move from state to state depending. The state is normally dictated by the a field in the form, in my example above is the status of the request:
1. Pending
2. Approved
3. Rejected
From this i worked out that i need my form to manage the state of the whole process and my workflow to respond to these changes. Based on what state the form was manaipulated to when a user changed values within the form, execute the relevant workflow step which is associated with that form state. So how might this work in a diagram?
Based on the above diagram i have created 2 videos which run you through both the Form and the workflow itself, explaining how i enabled the form to save the latest state within the form, and how my workflow reacts to these changes:
Form Video
Workflow Video
If you do have any questions, please post comments below, i will try to help out.










Hi…
First that all, Happy New Year 2010!
I found your article very useful and interesting, because I must to deploy a solution like this, with Infopath 2007 and a state machine workflow.
I write you because I tried to watch the videos that you posted (Form Video and Workflow Video) and both displays this message:
“This is a private video. If you have been sent this video, please make sure you accept the sender’s friend request”.
How I can watch those videos?
Thank you very much!
Best regards!
Same here ,even I would like to go through the videos .. seem interesting…
Please send me a request to watch them .. thanks
Hi Prasad,
It should be viewable now! sorry about this
Should be viewable, my apologies
I am not able to open the video.Can you please help me to open the video or send me the video thru mail
arumugaperumal.r@gmail.com
Thx
Videos seem to be working?
Thx.But i am seeing a blank box and not able to see/play any video….can you please send me the same to arumugaperumal.r@gmail.com