AshWorkflow.Entities.OnSignal (AshWorkflow v0.12.0)

Copy Markdown View Source

Defines a step's handler for a signal from an Ash.Signals module.

When the signal is emitted, the records in the step that filter or read_action selects either move to transition_to or run action. AshWorkflow generates the read action, the transition action, the signals_in listener and its policy.

Summary

Functions

Name of the hidden transition action, scoped by step like AshWorkflow.Transformers.AddActions.timeout_action_name/2.

The action the listener runs: the generated transition, or the handler's action.

Name of the signals_in listener, as react_to_signal(..., only: ...) takes it.

Name of the hidden read action that selects the records in the step.

Whether the handler moves the record to another of step_names, and so gets a generated transition action.

Types

t()

@type t() :: %AshWorkflow.Entities.OnSignal{
  __spark_metadata__: term(),
  action: atom() | nil,
  delivery: {module(), Keyword.t()} | nil,
  emits: [AshWorkflow.Entities.Emit.t()],
  filter: term() | nil,
  from: module() | nil,
  inputs: [{atom(), atom()}] | nil,
  name: atom(),
  read_action: atom() | nil,
  transition_to: atom() | nil
}

Functions

action_name(step_name, on_signal)

@spec action_name(atom(), t()) :: atom()

Name of the hidden transition action, scoped by step like AshWorkflow.Transformers.AddActions.timeout_action_name/2.

attribute_schema()

listener_action(step_name, on_signal)

@spec listener_action(atom(), t()) :: atom()

The action the listener runs: the generated transition, or the handler's action.

listener_name(step_name, on_signal)

@spec listener_name(atom(), t()) :: atom()

Name of the signals_in listener, as react_to_signal(..., only: ...) takes it.

read_action_name(step_name, on_signal)

@spec read_action_name(atom(), t()) :: atom()

Name of the hidden read action that selects the records in the step.

transitions?(on_signal, step_names)

@spec transitions?(t(), [atom()]) :: boolean()

Whether the handler moves the record to another of step_names, and so gets a generated transition action.