View Source LightningWeb.WorkflowLive.Helpers (Lightning v2.10.4)

Helper functions for the Workflow LiveViews.

Summary

Functions

Link to this function

broadcast_updated_params(socket, params)

View Source
Link to this function

run_workflow(workflow_or_changeset, params, opts)

View Source
@spec run_workflow(
  Ecto.Changeset.t(Lightning.Workflows.Workflow.t())
  | Lightning.Workflows.Workflow.t(),
  map(),
  selected_job: map(),
  created_by: map(),
  project: map()
) ::
  {:ok,
   %{
     workorder: Lightning.WorkOrder.t(),
     workflow: Lightning.Workflows.Workflow.t(),
     message: Lightning.Extensions.UsageLimiting.message()
   }}
  | {:error, Ecto.Changeset.t(Lightning.Workflows.Workflow.t())}
  | {:error, Ecto.Changeset.t(Lightning.WorkOrders.Manual.t())}
  | {:error, Lightning.Extensions.UsageLimiting.message()}
  | {:error, :workflow_deleted}
Link to this function

save_workflow(changeset, actor)

View Source
@spec save_workflow(
  Ecto.Changeset.t(),
  struct()
) ::
  {:ok, Lightning.Workflows.Workflow.t()}
  | {:error,
     Ecto.Changeset.t()
     | Lightning.Extensions.UsageLimiting.message()
     | :workflow_deleted}
Link to this function

subscribe_to_params_update(socket_id)

View Source