Skip to content

Elements

The elements module provides a comprehensive set of classes that represent various components of a state machine. The classes in this module can be utilized to model the states, transitions, events, and behaviors within a state machine architecture. Below is an overview of the main classes and enumerations within the module, each designed to encapsulate specific aspects of state machine behavior and functionality.

Classes

  • Vertex: The base class for nodes within the state machine graph, which can have incoming and outgoing transitions.

  • Transition: Represents a state change in the state machine, connecting two vertices and potentially associated with triggering events, guards, and effects.

  • TransitionPath: Describes the sequence of vertices a transition passes through, including the vertices to enter and leave during the transition.

Enumerations

  • ConcurrencyKind: Defines the types of concurrency mechanisms used, like threading, multiprocessing, or asynchronous execution.

  • TransitionKind: Categorizes transitions as internal, local, external, or self transitions.

  • PseudostateKind: Specifies various types of control nodes within the state machine, such as initial, choice, join, fork, and others.

Subclasses

  • FinalState: Represents an end state for a region within a state machine.

  • Pseudostate: A subclass of Vertex, representing different kinds of control points within the state machine, such as initial states or junction points.

  • State: A vertex that may contain nested regions, representing a state which can also have entry and exit behaviors.

  • Region: Organizes the structure of states and transitions, representing a distinct context for stateful behaviors.

  • Event: The base class for events which can trigger transitions.

  • Constraint: Represents a condition that guards transitions or influences state behavior.

  • StateMachine: Encapsulates the entire state machine structure and behavior, acting as a container for states, regions, and transitions.

Other Components

  • Behavior: Encapsulates the action or activity associated with a state or event within the state machine.

  • CompletionEvent: Represents an event that is fired upon the completion of a state's internal activity.

  • ChangeEvent: Triggers a transition based on a conditional expression being satisfied.

  • TimeEvent: Is fired when a specific time-related condition is met, like a timeout or an elapsed time period.

This module is intended to be used in conjunction with other modules and utilities that form a framework for state management and behavior modeling. The components defined here can be extended or used as is to create complex and robust state machines for various application domains.