Windows Workflow Foundation (WF4) - Tracking State Machine
This sample demonstrates how you can track the current state of a StateMachine and the possible transitions using the following classes from Microsoft.Activities.Extensions
StateMachineStateTracker and StateTrackerPersistenceProvider