Repository navigation
v0.11.0
·
256 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Upgrading from 0.10.2
ash_workflownow depends onash ~> 3.35, forAsh.Signals.
Added
- Workflow signals. The new
signalsoption on theworkflowsection names anAsh.Signalsmodule, andemitdeclares a signal at four levels: the workflow (every state change), a step (on: :enteroron: :exit), atransition, and atimeoutorevery.AshWorkflow.Changes.RecordEventemits each matching signal in itsafter_actionhook, after the log row, with a payload of the workflow fieldsfrom_state,to_state,transition_name,triggered_byandoccurred_at, the attributes that share a signal field's name, theemit'sfieldsand its literalvalues. A failing listener fails the action and rolls it back.AshWorkflow.Transformers.AddActionsdeclares each planned signal as a dynamic emit on the action, andAshWorkflow.Verifiers.ValidateSignalschecks the names and phases.AshWorkflow.Info.signals/1,emits/1andaction_signals/2read the configuration. Atransition,timeoutoreverythat contains anemittakes its options inside thedoblock. See the Signals guide. - Receiving signals with
on_signal. A step can declareon_signal, which moves a record totransition_to, or runs an updateaction, when a signal from the workflow'ssignalsmodule (orfrom) selects that record while it is in the step.filterselects records with^signal(:field)templates, orread_actionnames a read action of the resource.AshWorkflow.Transformers.AddActionsgenerates the:__signal_<step>_<signal>_readread action, the:__signal_<step>_<signal>transition action and asignals_inlistener named:<step>_<signal>, and the log row recordstriggered_by: :signal.AshWorkflow.Transformers.AddPoliciesauthorizes the generated actions withsignal_in/2.AshWorkflow.Verifiers.ValidateOnSignalchecks the signal, its fields and the outcome, and a step whose only exits areon_signalhandlers withtransition_tois a wait state. Charts draw anon_signaledge with📨. See the Signals guide.