The State Machine workflow functionality provided with Windows Workflow Foundation provides a powerful way to model the control flow of applications. In this screencast,
James Conard, shows an example Order Processing application that utilizes a State Machine workflow for managing the states of an order. The demo also shows how an application can have visibility into running workflow
and even change the steps (activities) within a workflow dynamically.
You can download all of the code for this example from the Windows Workflow Foundation site at
http://www.WindowsWorkflow.net/downloads