machinery v0.16.0 Machinery.Transition View Source

Machinery module responsible for control transitions, guard functions and callbacks (before and after). This is meant to be for internal use only.

Link to this section Summary

Functions

Function responsible to run all after_transitions callbacks or fallback to a boilerplate behaviour. This is meant to be for internal use only

Function responsible to run all before_transitions callbacks or fallback to a boilerplate behaviour. This is meant to be for internal use only

Function responsible for checking if the transition from a state to another was specifically declared. This is meant to be for internal use only

Default guard transition fallback to make sure all transitions are permitted unless another existing guard condition exists. This is meant to be for internal use only

Function resposible for triggering transitions persistence. This is meant to be for internal use only

This function will try to trigger persistence, if declared, to the struct changing state. This is meant to be for internal use only

Link to this section Functions

Link to this function after_callbacks(struct, state, module) View Source
after_callbacks(struct(), atom(), module()) :: struct()

Function responsible to run all after_transitions callbacks or fallback to a boilerplate behaviour. This is meant to be for internal use only.

Link to this function before_callbacks(struct, state, module) View Source
before_callbacks(struct(), atom(), module()) :: struct()

Function responsible to run all before_transitions callbacks or fallback to a boilerplate behaviour. This is meant to be for internal use only.

Link to this function declared_transition?(transitions, current_state, next_state) View Source
declared_transition?(list(), atom(), atom()) :: boolean()

Function responsible for checking if the transition from a state to another was specifically declared. This is meant to be for internal use only.

Link to this function guarded_transition?(module, struct, state) View Source
guarded_transition?(module(), struct(), atom()) :: boolean()

Default guard transition fallback to make sure all transitions are permitted unless another existing guard condition exists. This is meant to be for internal use only.

Link to this function log_transition(struct, state, module) View Source
log_transition(struct(), atom(), module()) :: struct()

Function resposible for triggering transitions persistence. This is meant to be for internal use only.

Link to this function persist_struct(struct, state, module) View Source
persist_struct(struct(), atom(), module()) :: struct()

This function will try to trigger persistence, if declared, to the struct changing state. This is meant to be for internal use only.