Finitomata.State (Finitomata v0.41.0)

Copy Markdown View Source

Carries the state of the FSM.

Summary

Types

The last error which happened on transition; see Finitomata.Error.

The parent process for this particular FSM implementation

The payload that has been passed to the FSM instance on startup

t()

The internal representation of the FSM state

Functions

Exposes the short excerpt from state of FSM which is log-friendly

Types

last_error()

@type last_error() :: Finitomata.Error.t() | nil

The last error which happened on transition; see Finitomata.Error.

parent()

@type parent() :: nil | pid()

The parent process for this particular FSM implementation

payload()

@type payload() :: any()

The payload that has been passed to the FSM instance on startup

t()

@type t() :: %Finitomata.State{
  name: Finitomata.fsm_name(),
  finitomata_id: Finitomata.id(),
  parent: parent(),
  lifecycle: :loaded | :created | :failed | :unknown,
  persistency: nil | module(),
  listener: nil | module(),
  current: Finitomata.Transition.state(),
  payload: payload(),
  timer: false | {reference(), pos_integer()},
  cache_state: boolean(),
  hibernate:
    boolean() | Finitomata.Transition.state() | [Finitomata.Transition.state()],
  history: [Finitomata.Transition.state()],
  last_error: last_error()
}

The internal representation of the FSM state

Functions

excerpt(state, payload? \\ true)

Exposes the short excerpt from state of FSM which is log-friendly