Mobus.Stepwise.Components.StepwiseAdvance (mobus_stepwise v0.2.0)

Copy Markdown View Source

Advances (or reverses) the current step for stepwise workflows.

Step ordering is derived from Mobus.Stepwise.SpecHelpers.ordered_steps/1:

  • spec.steps (list of step IDs), otherwise
  • states with step_number (ascending)

Supported events:

  • :next / "next"
  • :back / "back"

Summary

Functions

Advances or reverses the current step based on the event.

Functions

call(event, opts)

@spec call(map(), map()) :: map()

Advances or reverses the current step based on the event.

This is an ALF pipeline stage. For :next/"next" events, moves to the next step in order. For :back/"back", moves to the previous step. For custom events, looks up explicit transitions in spec.transitions. Updates history and trace on successful transitions.

Skipped when skip_transition: true is set (projection-only mode) or on error status.

Parameters

  • event — pipeline event map with :spec, :runtime, :event, :payload
  • opts — ALF stage options (unused)

Returns

  • Updated event map with :runtime (potentially new current_state), :previous_state, and :state_changed? flag.