Lightning.WorkOrder (Lightning v2.19.2)

Copy Markdown View Source

Ecto model for WorkOrders.

Summary

Functions

Returns the list of active (in-progress) work order states.

Returns the list of failure states for a work order.

Returns the list of final states for a work order.

Buckets a work order state into :success, :cancelled, :pending or :failed.

Returns all possible states for a work order.

Types

t()

@type t() :: %Lightning.WorkOrder{
  __meta__: Ecto.Schema.Metadata.t(),
  dataclip: Lightning.Invocation.Dataclip.t() | Ecto.Association.NotLoaded.t(),
  dataclip_id: term(),
  id: Ecto.UUID.t() | nil,
  inserted_at: term(),
  jobs: term(),
  last_activity: term(),
  runs: term(),
  snapshot: Lightning.Workflows.Snapshot.t() | Ecto.Association.NotLoaded.t(),
  snapshot_id: term(),
  state: atom(),
  trigger: Lightning.Workflows.Trigger.t() | Ecto.Association.NotLoaded.t(),
  trigger_id: term(),
  updated_at: term(),
  workflow: Lightning.Workflows.Workflow.t() | Ecto.Association.NotLoaded.t(),
  workflow_id: term()
}

Functions

active_states()

Returns the list of active (in-progress) work order states.

failure_states()

Returns the list of failure states for a work order.

These are all final states except :success and :cancelled — someone stopped a cancelled work order on purpose, so it is not a failure.

final_states()

Returns the list of final states for a work order.

Every state a work order can settle in: Run.final_states/0 plus :rejected, which is what a work order whose run was never created settles in.

outcome(state)

Buckets a work order state into :success, :cancelled, :pending or :failed.

states()

Returns all possible states for a work order.

validate(changeset)