AshWorkflow.Entities.TransitionLog (AshWorkflow v0.8.0)

Copy Markdown View Source

Configures an opt-in transition log for a workflow.

When present, AshWorkflow.Changes.RecordEvent appends one row per workflow event to resource, and the resource gains the state_at/2 and history/1 code interface functions and a public has_many :transitions relationship to resource. A :transitions relationship defined on the workflow resource takes precedence.

The log resource itself is user-owned, not generated — see AshWorkflow.Verifiers.ValidateTransitionLog for the schema it must satisfy.

Summary

Functions

Returns the configured actor capture, or nil if none is configured.

Returns the actor a log row records for actor, or nil if it records none.

Types

t()

@type t() :: %AshWorkflow.Entities.TransitionLog{
  __spark_metadata__: term(),
  belongs_to_actor: [AshWorkflow.Entities.BelongsToActor.t()],
  resource: module()
}

Functions

attribute_schema()

belongs_to_actor(transition_log)

@spec belongs_to_actor(t()) :: AshWorkflow.Entities.BelongsToActor.t() | nil

Returns the configured actor capture, or nil if none is configured.

recorded_actor(log, actor)

@spec recorded_actor(t(), term()) :: term()

Returns the actor a log row records for actor, or nil if it records none.

It is nil when no actor capture is configured, when actor is nil, and when skip_other_actors? is set and actor is not a destination struct.