StateMachine vs Flowchart RRS feed

  • Question

  • I have a Workflow for a Training Request process (user would like training, enters a request, it goes up a chain of approval (can be rejected and recalled in this process).

    Would I implement using the Flowchart or a StateMachine? 

    Some of the steps involved in the WF are: Draft (user can enter the request but not submit it up right away), Level 1 review (where a level 1 manager reviews it, can approve it up or send it back to draft); Level 2 review (where a level 2 director reviews it, can approve it up, send it back to level 1 for more info, or reject it where it stops); Level 3 review (where a level 3 VP approves it wherein it becomes complete, rejects it, or sends it back to level 2).

    This seems to indicate state (since it's a long running workflow wherein the state (or level at which it is sitting) would be persisted.  Is this a correct assumption?

    Sorry if this is a silly question - new to WF.  I have read through numerous samples and how-tos, but haven't seen any guidance on when to use FlowChart vs when to use State Machine.

    Thanks in advance!


    Wednesday, July 20, 2011 8:17 PM


  • In theory it's possible to implement any scenario using either Flowchart (and maybe some parallel/pick activities) or StateMachine.

    If you want to have a lot of choices 'either this event or that event can happen' where the events are Receive activities, then StateMachine is usually better suited to modelling this. I think your scenario sounds most suitable to StateMachine.

    (How might I do it with Flowchart? You can also achieve much the same thing by condensing all your events into a single Receive activity, and doing branches based on the data received.)
    • Proposed as answer by Andrew_Zhu Tuesday, July 26, 2011 10:24 AM
    • Marked as answer by Andrew_Zhu Wednesday, July 27, 2011 7:56 AM
    Thursday, July 21, 2011 3:20 AM