Anatomy of a State Machine


State-machine workflows involve a few concepts that you should understand before trying to work with them, probably the most important of which is a state itself. A state in a state machine represents a mode or status a process can be in at a point in time. For example, consider a microwave. There are several states in which a microwave can be, including waiting for activity, cooking, and defrosting. Generally, a microwave - or any other state machine, for that matter - can be in only one state at a time.

Transitions are another vital concept of state machines. Whereas states represent what a workflow is doing at a given point in time, transitions define how a state machine moves from one state to another. It is extremely important to understand that a state machine does not necessarily have one defined path that dictates movement from State A to State B to State C. State machines can move from A to B, B to A, and finally from A to C, if appropriate. The execution path can vary every single time a state-machine workflow is executed. Transitions define the actions or events that may occur to cause the movement from one state to another.

State-machine workflows also have the concept of an initial and completed state. A state-machine workflow is in its initial state before anything happens and while it is waiting to transition to another state based on some event. As you may imagine, the completed state is what is transitioned to when the workflow has completed its final steps.



Professional Windows Workflow Foundation
Professional Windows Workflow Foundation
ISBN: 0470053860
EAN: 2147483647
Year: 2004
Pages: 118
Authors: Todd Kitta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net