View Source Lightning.Jobs (Lightning v2.10.4)
The Jobs context.
Summary
Functions
Returns an %Ecto.Changeset{}
for tracking job changes.
Creates a job.
Returns the list of downstream jobs for a given job, optionally matching a specific trigger type. When downstream_jobs_for is called without a trigger that means its between jobs when it called with a trigger that means we are starting from outside the pipeline
Gets a single job.
Returns the list of jobs excluding the one given.
Returns the list of jobs.
Updates a job.
Functions
Returns an %Ecto.Changeset{}
for tracking job changes.
Examples
iex> change_job(job)
%Ecto.Changeset{data: %Job{}}
Creates a job.
Examples
iex> create_job(%{field: value})
{:ok, %Job{}}
iex> create_job(%{field: bad_value})
{:error, %Ecto.Changeset{}}
@spec get_downstream_jobs_for( Lightning.Workflows.Job.t() | Ecto.UUID.t(), Lightning.Workflows.Edge.edge_condition() | nil ) :: [Lightning.Workflows.Job.t()]
Returns the list of downstream jobs for a given job, optionally matching a specific trigger type. When downstream_jobs_for is called without a trigger that means its between jobs when it called with a trigger that means we are starting from outside the pipeline
Gets a single job.
Raises Ecto.NoResultsError
if the Job does not exist.
Examples
iex> get_job!(123)
%Job{}
iex> get_job!(456)
** (Ecto.NoResultsError)
@spec get_upstream_jobs_for(Lightning.Workflows.Job.t()) :: [ Lightning.Workflows.Job.t() ]
Returns the list of jobs excluding the one given.
@spec jobs_for_project(Lightning.Projects.Project.t()) :: [ Lightning.Workflows.Job.t() ]
@spec jobs_for_project_query(Lightning.Projects.Project.t()) :: Ecto.Queryable.t()
Returns the list of jobs.
@spec list_jobs_for_workflow(Lightning.Workflows.Workflow.t()) :: [Lightning.Workflows.Job.t(), ...] | []
Updates a job.
Examples
iex> update_job(job, %{field: new_value})
{:ok, %Job{}}
iex> update_job(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}