API Reference Maxine v1.1.1
Modules
Functions for dealing with machines: to wit, generate/2
, which
creates an initial %State{}
struct from a %Machine{}
, and
advance/3
(along with companion advance!/3
) which transforms
one %State{}
into another one according to the rules given in
the machine.
Helper functions for use in callbacks. These get their own module because they really don't belong with generate/2 and advance/3. The idea is that you
Compose individual machines using the optional
DeepMerge
dependency.
Where we put application data; the only way for
callbacks to communicate with the outside world.
Note that at each event, :tmp
is wiped and :options
is updated to reflect whatever the current event was
called with.
Ecto bindings for Maxine. Provides
The various types of failure we may encounter.
For failures in the callback phase. For use by callbacks themselves; we don't call this one directly here. Use cause to wrap a more specific error.
When a machine returns something other than a %Data{} or a %CallbackError.
Called when the underlying machine is faulty and causes something unhandleable in the API.
When a machine requests a non-existent callback function.
On a non-existent event.
On a non-existent state.
When the event has no transition mapped for the present state.
The actual machine structure
Sentinel values used by Maxine to signal that no
further event has been requested, (Halt
) and that no transition for the
current state was found for a given name of that state, and
resolve_next_state
should keep looking under the state's other
names (Pass
).
The "state" part of "state machine." These are the structs we actually pass around, call events on, and transform in the course of normal use.
A behaviour that specifies a machine and a set of filters to transform and/or
validate a changeset. The machine is a %Maxine.Machine{}
and the filters
are given in two functions, events/0
and states/0
that return maps keyed
by event name, and whose values are modules implementing the
are a module or function to be passed as the validate_with
option to
cast_state/3
. See cast_workflow/3
and cast_state/3
for more
information.