Using the SetStateActivity Activity

A state machine by nature uses information that it receives through various events to move from one state to another. This transition between states is performed by the SetStateActivity activity. The target of a SetStateActivity activity must be a "leaf" state that does not contain any other states.

In an EventDrivenActivity activity or a StateInitializationActivity activity, multiple SetStateActivity activities can be executed, but the last SetStateActivity activity determines the final state in that StateInitializationActivity or EventDrivenActivity activity.

For more information about the SetStateActivity class, see the System.Workflow.Activities namespace in the Windows Workflow Foundation Class Library reference.

For a code sample that demonstrates how to use the SetStateActivity activity, see Simple State Machine.

See Also

Reference

SetStateActivity
StateActivity
EventDrivenActivity
StateInitializationActivity

Concepts

State Machine Workflows

Other Resources

Simple State Machine Sample
Windows Workflow Foundation Activities