ex_state v0.3.0 ExState.Execution View Source
ExState.Execution executes state transitions with a state chart.
Link to this section Summary
Functions
Completes a step and transitions the execution with {:completed, step_id} event.
Continues a workflow execution from the specified state.
Completes a decision and transitions the execution with {:decision, step_id, decision} event.
Returns serializable data representing the execution.
Executes the provided action name through the callback module.
Executes any queued actions on the execution.
Creates a new workflow execution from the initial state.
Transitions execution with the event and returns a result tuple.
Transitions execution with the event and returns updated or unchanged execution.
Continues a workflow execution with the completed steps.
Use in conjunction with continue to resume execution.
Link to this section Types
t()
View Sourcet() :: %ExState.Execution{
actions: [atom()],
callback_mod: module(),
chart: ExState.Definition.Chart.t(),
context: map(),
history: [ExState.Definition.State.t()],
meta: map(),
state: ExState.Definition.State.t(),
transitions: [ExState.Definition.Transition.t()]
}
Link to this section Functions
Completes a step and transitions the execution with {:completed, step_id} event.
Continues a workflow execution from the specified state.
continue(chart, callback_mod, state_name, context)
View Sourcecontinue(ExState.Definition.Chart.t(), module(), String.t(), map()) :: t()
Completes a decision and transitions the execution with {:decision, step_id, decision} event.
Returns serializable data representing the execution.
Executes the provided action name through the callback module.
Executes any queued actions on the execution.
Creates a new workflow execution from the initial state.
new(chart, callback_mod, context)
View Sourcenew(ExState.Definition.Chart.t(), module(), map()) :: t()
transition(execution, event)
View Sourcetransition(t(), ExState.Definition.Transition.event()) :: {:ok, t()} | {:error, String.t(), t()}
Transitions execution with the event and returns a result tuple.
Transitions execution with the event and returns updated or unchanged execution.
Continues a workflow execution with the completed steps.
Use in conjunction with continue to resume execution.