View Source AshStateMachine (ash_state_machine v0.2.5)

Provides tools for defining and working with resource-backed state machines.

Summary

Functions

A reusable helper which returns all possible next states for a record (regardless of action).

A reusable helper which returns all possible next states for a record given a specific action.

A utility to transition the state of a changeset, honoring the rules of the resource.

Functions

Link to this function

possible_next_states(record)

View Source
@spec possible_next_states(Ash.Resource.record()) :: [atom()]

A reusable helper which returns all possible next states for a record (regardless of action).

Link to this function

possible_next_states(record, action_name)

View Source
@spec possible_next_states(Ash.Resource.record(), atom()) :: [atom()]

A reusable helper which returns all possible next states for a record given a specific action.

Link to this function

transition_state(changeset, target)

View Source

A utility to transition the state of a changeset, honoring the rules of the resource.