Many people build applications that use the current state and possible transitions of a state machine to enable or disable commands in the user interface. Unlike WF3, in WF4, any activity can contain a state machine, including other state
machines. Therefore any workflow may have multiple state machines, each of which could be in a different state, however only one of them is active at any given time.
The solution is to use a tracking participant and persistence participant to track the current state and possible transitions. There are two classes which you will use to do this.
Step by Step