2023-04-22 16:33:28 +12:00
|
|
|
defmodule AshStateMachine.BuiltinChanges do
|
2023-04-22 07:25:39 +12:00
|
|
|
@moduledoc """
|
2023-04-22 16:33:28 +12:00
|
|
|
Changes for working with AshStateMachine resources.
|
2023-04-22 07:25:39 +12:00
|
|
|
"""
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Changes the state to the target state, validating the transition
|
|
|
|
"""
|
|
|
|
def transition_state(target) do
|
2023-04-22 16:33:28 +12:00
|
|
|
{AshStateMachine.BuiltinChanges.TransitionState, target: target}
|
2023-04-22 07:25:39 +12:00
|
|
|
end
|
2023-09-08 13:35:51 +12:00
|
|
|
|
|
|
|
@doc """
|
2023-09-16 01:40:28 +12:00
|
|
|
Try and transition to the next state. Must be only one possible next state.
|
2023-09-08 13:35:51 +12:00
|
|
|
"""
|
|
|
|
def next_state, do: AshStateMachine.BuiltinChanges.NextState
|
2023-04-22 07:25:39 +12:00
|
|
|
end
|