Generates ash_state_machine configuration from workflow steps.
Injects the following into the resource's state_machine DSL:
state_attribute— the workflow'sstate_attribute, when it declares one.initial_states— set to the step withinitial: true, or the first non-terminal step by declaration order if none is marked.default_initial_state— same as above- Transitions for each step type:
- Automatic steps —
transition :step_action, from: [:step_name], to: [...], wheretois every target across the step'son_successentries. Ifon_erroris set, a transition named__on_error_<step>to the error state is added — declared on the error handler action rather than on the step's own action, since that is what AshOban invokes when the step fails. - Manual steps — one transition per declared
transitionentity, e.g.transition :approve, from: [:review], to: [:approved] - Undoable transitions — when the workflow declares an
undoblock, two:undotransitions per undoable edge, one in each direction, so both a rewind and a subsequent redo are permitted. - Timeouts with
transition_to— a transition named__timeout_<step>_<name>, e.g.transition :__timeout_review_escalation, from: [:review], to: [:escalated]
- Automatic steps —
Must run before all AshStateMachine.Transformers.* so that the state machine
extension sees the generated states and transitions.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.