Dennis van der Stelt

The most votes generally drown out the best votes

Community

News

  • Meet me at PDC08

Email Notifications

I read...

I Use...

Tags

Recent Posts

Archives

State machine workflow to difficult for you?

Recently Anko Duizer started a discussion inside Class-A about Windows Workflow Foundation, specifically about state machine workflow vs. sequential workflow. One point of discussion was why in (almost) every presentation out there, the sequential workflow is being demonstrated.

Sequential workflows are pretty easy to understand and probably most used in design documents. However, I've implemented Workflow Foundation on several projects and have always used a state machine workflow, simply because it was the best possible solution to the problem at hand. And although I never actually thought about it, the discussion internally made me wonder myself if sequential workflow has any use. I've used them inside the different states of my state machine, but never have I used a sequential workflow on its own.

Is this because they don't represent anything but simple if statements in your code? And everything that spans over time is implemented using a state machine? Are state machines so hard to explain to people, or do the presenters just don't get them? Anko also proves in his article that the workflow of the expense demo, published on MSDN, is much easier to draw, implement and query the state with a state machine workflow.

I'm curious if people have implemented sequential workflows in their applications and could explain the why and how? Leave a comment here or on Anko's weblog.

Comments

Nick Sevens said:

I'm currently implementing a workflow into a project, also using the sequential workflow.

Main reason is indeed the ammount of information found on the net. Actually, I simply don't know the difference between the two types ...

# March 23, 2007 5:19 AM

Mike Blaak said:

I've recently used WF in combination with SharePoint 2007, and built a custom statemachine workflow because the process required a loop between several tasks.

If you can't predict how often you want to loop around, a statemachine workflow is easier although you could model a while activity in a sequential workflow.

I would say you use a sequential workflow when the possible paths your process has are straightforward (more like a decision tree) and contain no or little looping around.

Another thing is that inside the individual states of a statemachine workflow, you model sequential flows of activities to get things done (I guess without any form of sequential workflow that would not be possible) or you have to write custom activities to handle all this

# June 24, 2007 1:05 PM

Arumugam Shanmugam said:

Mike Blaak,

I am encouraged to see your comment here. We are attempting to implement a Business Process like Accounts Payable using WF in combination with Sharepoint 2007. The MSDN documentation is restricted to sequential workflows in web environment. Any help is appreciated.

Best Regards

Aru

# July 24, 2007 12:43 AM

Hisham Samara said:

Seq WF has a start and end points but state machine does not usually!

based on that take your decision.

Regards

# August 6, 2007 6:40 PM

Manny said:

Thank you Dennis for this post. You are absolutely right that the State Machine WF really should be the most natural one to use in the myriad examples MS and others put out. After all, the biggest benefits of workflows come from implementing <strong>long running</strong> processes in organizations. Limiting most examples to simple sequential WFs really undermines the perceived power of the toolkit (especially in the minds of people who have not delved into WF development before).

# June 16, 2008 5:16 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)