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.

You may also like...

11 Responses

  1. Nick Sevens says:

    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 …

  2. Mike Blaak says:

    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

  3. Arumugam Shanmugam says:

    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


  4. Hisham Samara says:

    Seq WF has a start and end points but state machine does not usually!
    based on that take your decision.

  5. Manny says:

    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 long running 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).

  6. Joe says:

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

    This is totally foolish. Every state machine had its own initial state and finals states.

  7. Sharif says:

    Can this be a research idea?

  8. SDW says:

    I’ve got to build a workflow and I’m just off the sharepoint training. The sharepoint training only covers sequential workflows yet I read that state machine are by far the most useful. I’ve been searching on the web and the biggest problem I have with all of the examples is the step by step instructions seem to mainly consist of renaming components (something that gets very confusing as the names aren’t very generic or easy to remember) and they spend little time explaining why you’re doing that step (as it may not be relevant to my workflow). I’ve got several books too and they’re not helpful either. At this rate I’m going to end up using a sequential workflow because the help out there is much better and they are simpler to understand. We need to find someone who can convert all of the state machine workflow jargon into english and explain it to those of us that are new to this.

  9. Ashwin says:

    Hi Dennis
    I am recently stuck with a problem on SM Workflows. I am not able to create multiple parallel task using replicator in State Machine. There can be arbitraty in number which might be based on some Business logic. Any ideas would be helpful

  10. Krzysztof says:

    To create state machine workflows for SharePoint you should check Datapolis Workbox – it’s a graphical workflow designer based on Silverlight.

  11. fadi z says:

    does anyone know how to use replicator in SM wf?

Leave a Reply

Your email address will not be published. Required fields are marked *