Lightning.Workflows.Workflow (Lightning v2.13.4)

View Source

Ecto model for Workflows.

A Workflow contains the fields for defining a workflow.

  • name A plain text identifier

Summary

Functions

Forces an update to the workflows updated_at timestamp and the lock_version. This is useful when updating a child record like jobs or triggers and a snapshot needs to made; but the Workflow itself didn't change.

Returns true if the workflow has any triggers that are going to be activated.

Types

t()

@type t() :: %Lightning.Workflows.Workflow{
  __meta__: Ecto.Schema.Metadata.t(),
  concurrency: term(),
  delete: term(),
  deleted_at: term(),
  edges: term(),
  enable_job_logs: term(),
  id: Ecto.UUID.t() | nil,
  inserted_at: term(),
  jobs: term(),
  lock_version: term(),
  name: String.t() | nil,
  positions: term(),
  project:
    nil | Lightning.Projects.Project.t() | Ecto.Association.NotLoaded.t(),
  project_id: term(),
  runs: term(),
  snapshots: term(),
  triggers: term(),
  updated_at: term(),
  work_orders: term()
}

Functions

request_deletion_changeset(workflow, attrs)

touch(workflow)

@spec touch(t()) :: Ecto.Changeset.t(t())

Forces an update to the workflows updated_at timestamp and the lock_version. This is useful when updating a child record like jobs or triggers and a snapshot needs to made; but the Workflow itself didn't change.

validate(changeset)

workflow_activated?(changeset)

@spec workflow_activated?(Ecto.Changeset.t()) :: boolean()

Returns true if the workflow has any triggers that are going to be activated.

New triggers are enabled by default, but existing triggers are only considered activated if their enabled field is changed to true.