[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
   Client-Side Mobile Application
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Collapse]Extra Modules
   [Expand]Audit Trail Module Overview
    Business Class Library Customization Module
    Chart Module
    Clone Object Module
   [Expand]Conditional Appearance Module Overview
   [Expand]Dashboards Module
    File Attachments Module Overview
    HTML Property Editor Module
    Localization Module Overview
   [Expand]Notifications Module
    KPI Module
   [Expand]Maps Module
   [Expand]Pivot Chart Module
    Pivot Grid Module
   [Expand]Reports V2 Module
   [Expand]Reports Module (Obsolete)
   [Expand]Scheduler Module
    Script Recorder Module
   [Collapse]State Machine Module
     State Machine Module Overview
     User-Defined State Transitions Specified at Runtime
     Predefined State Transitions Created in Code
   [Expand]TreeList Editors Module
   [Expand]Validation Module
    View Variants Module
   [Expand]Workflow Module
  [Expand]Debugging, Testing and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

State Machine Module Overview

Business objects often have an associated state specified by their property values (e.g., the Task object has Task.Status, which can be NotStarted, InProgress, etc.). While this state can easily be changed by modifying corresponding property values, managing state transitions in a uniform way is not that simple. This is why XAF ships with the State Machine module, which greatly simplifies state transition management.

Expanded State Machine Capabilities

The module creates a set of Actions that correspond to state transitions and display them in corresponding Views.

With the State Machine, you can:

  • define a set of states and corresponding transitions, and associate them with a business class. You can do this in code or at runtime, as the State Machine module comes with predefined Views for state and transition management. The property whose values specify different object states can be either an enumeration-typed property or a reference property;
  • define Conditional Appearance rules and associate them with particular states. This can also be done both in code and at runtime.
Important

In certain scenarios, creating a custom Controller with the SingleChoiceAction Action or a set of SimpleAction Actions can be simpler and more straightforward than defining a coded State Machine. So, if you need to define a static state management process that should not be changed by users, consider this approach first instead of using the State Machine module.

See Also:

Add a Simple Action
Add a Parametrized Action
How to: Include an Action to a Detail View Layout

Note

In the DataView and InstantFeedback data access modes, State Machine requests selected objects from the database each time the selection is changed.

Expanded Add the State Machine Module

To use the State Machine module in your WinForms or ASP.NET application, add it by using the Application Designer. Invoke the Application Designer and drag the StateMachineModule item from the Toolbox to the Modules panel. Be sure to rebuild your solution after making changes in the Designer.

Note

Expanded See Also

Is this topic helpful?​​​​​​​