StateMachine Activity Designer

The StateMachine activity contains a collection of states and models workflows using the familiar state machine paradigm.

Note

State machine functionality in Windows Workflow Foundation (WF) was introduced as part of the Update 4.0.1 for Microsoft .NET Framework 4 (KB2478063). To create state machine workflow applications in Visual Studio 2010, the Update 4.0.1 for Microsoft .NET Framework 4 – Design-time Package for Visual Studio 2010 SP1 (KB2495593) is required. For more information and instructions on how to download and configure these updates, see Update 4.0.1 for Microsoft .NET Framework 4 Features.

Using the StateMachine Activity Designer

To add a StateMachine activity, drag the StateMachine activity designer from the State Machine section of the Toolbox and drop it on to the Windows Workflow Designer surface. To add a child state to this StateMachine activity, drag a State or FinalState from the Toolbox and drop it onto the StateMachine.

StateMachine Activity Properties in the Workflow Designer

The following table shows the StateMachine properties that can be set using the workflow designer and describes how they are used in the designer. These properties can be edited in the property grid and some can be edited on the designer surface.

Property Name Required Usage

DisplayName

False

Specifies the friendly name of the StateMachine activity designer in the header. The default value is StateMachine. The value can be edited in the property grid or directly on the header of the activity designer. The DisplayName is used in the breadcrumb navigation that is displayed at the top of the workflow designer.

Although the DisplayName is not strictly required, it is a best practice to use one.

Note

If the state machine activities do not appear in the Toolbox, ensure that the Target framework is set to one of the .NET Framework 4 Platform Update 1 profiles in the project properties.

Project Properties

See Also

Concepts

Flowchart Activity Designer

Other Resources

Control Flow Activity Designers