View Source EcspanseStateMachine.Components.StateMachine (ECSpanse State Machine v0.3.0)

The state machine component tracks the running status and current state.

Fields

  • initial_state: the state the machine should be in at start
  • current_state: the state the machine is in now
  • states: keyword lists of states [:name, exits[:exit_state1, :exit_state2...], :timeout, :default_exit]
  • auto_start: if true, the machine will be automatically started

Summary

Functions

Produces a list of states visited via depth first

Retrieves the keyword list with the provided name

Callback implementation for Ecspanse.Component.validate/1.

Types

@type state_name() :: atom() | String.t()

Functions

@spec flatten(any()) :: [state_name()]

Produces a list of states visited via depth first

Link to this function

get_state_spec(state_machine, name)

View Source
@spec get_state_spec(any(), state_name()) :: keyword() | {:error, String.t()}

Retrieves the keyword list with the provided name

Callback implementation for Ecspanse.Component.validate/1.