.net4.0.3 vs2012 - StateMachine, How To Leverage WF in LOB application business rules RRS feed

  • Question

  • I have yet to run across any good examples using 4.0.3 statemachines, at least not any examples that helps me understand this.

    Is anyone aware of a not too simple and not too complex example?

    Here's my current scenario.  My statemachine is hosted in a wpf application, and will not persist to a DB.  In my first state for the ENTRY I have a SEQUENCE that [creates an Entity Framework DBContext] > [queries DBContext using InArguments from the statemachine and saves entity result to the STATEMACHINE scope]. 

    The first state EXIT is an [IF entity result is nothing, then create new entity, else do nothing]

    The first state transition condition is [entity IS NOT nothing]

    How do I trigger the transition?  Should my exit activity be in the first state's trigger?  I have no clue... :(

    In general I believe I am correct that triggers usually are nativeactivities that create a named bookmark, however in the case of my first state, I don't really have a trigger... Or, should I create a bookmark named lets say "InitializeStateMachine", and resume that bookmark from my hosting application after I run the WorkflowApplication?

    I think all I need is a little more clarity on properly using StateMachines, or perhaps I should just use FlowChart instead.  The requirements for this have a rather complicated set of business rules where there are multiple entities with multiple statuses, and types, which result in multiple conditions that must be met in order to proceed through the workflow.

    Please help, asap :)



    Saturday, October 12, 2013 1:30 AM


All replies