All of the workflows we've examined so far have been sequential workflows. Windows Workflow also supports state-machine workflows, which is where the activities in this section come into play.
A state machine consists of a set of states. For instance, a state machine to model the workflow of a software bug might include the states open, assigned, closed, and
deferred. The workflow must always be in one of these four states. State machines are completely event driven. Only when the workflow receives an event can the current state transition to a new state. A state machine must have an initial state, and optionally an ending state. When the state machine transitions to the ending state, the workflow is complete.
State machine workflows are a good fit for modeling a process where decisions come from outside the workflow. When we make a decision, like closing a bug, we have a local communication service raise an event to the workflow. The workflow keeps track of which state...