Machinery.Transition (machinery v1.1.0) 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 responsible 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, extra_metadata)

View Source

Specs

after_callbacks(struct(), atom(), module(), map()) :: 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, extra_metadata)

View Source

Specs

before_callbacks(struct(), atom(), module(), map()) :: 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

Specs

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, extra_metadata)

View Source

Specs

guarded_transition?(module(), struct(), atom(), map()) :: 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, extra_metadata)

View Source

Specs

log_transition(struct(), atom(), module(), map()) :: struct()

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

Link to this function

persist_struct(struct, state, module, extra_metadata)

View Source

Specs

persist_struct(struct(), atom(), module(), map()) :: struct()

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