View Source StepFlow.Jobs (StepFlow v1.8.0)
The Jobs context.
Summary
Functions
Returns an %Ecto.Changeset{}
for tracking job changes.
Creates a job with a completed status.
Creates a job with an error status.
Creates a job.
Creates a job with a paused status.
Creates a job with a skipped status.
Deletes a Job.
Gets a single job by workflow ID and step ID
Gets a single job by workflow ID and step ID
Gets a single job.
Gets a single job.
Gets a single job with its related status.
Returns the list of jobs pending"
Returns the list of jobs pending"
Returns the list of jobs.
Set skipped status to all queued jobs.
Updates a job.
Functions
Returns an %Ecto.Changeset{}
for tracking job changes.
Examples
iex> change_job(job)
%Ecto.Changeset{source: %Job{}}
Creates a job with a completed status.
Examples
iex> create_completed_job(workflow, step_id, "webhook_notification")
{:ok, "completed"}
Creates a job with an error status.
Examples
iex> create_error_job(workflow, step_id, "download_http", "unsupported step")
{:ok, "created"}
Creates a job.
Examples
iex> create_job(%{field: value})
{:ok, %Job{}}
iex> create_job(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Creates a job with a paused status.
Examples
iex> create_paused_job(workflow, 1, "download_http")
{:ok, "paused"}
Creates a job with a skipped status.
Examples
iex> create_skipped_job(workflow, 1, "download_http")
{:ok, "skipped"}
Deletes a Job.
Examples
iex> delete_job(job)
{:ok, %Job{}}
iex> delete_job(job)
{:error, %Ecto.Changeset{}}
Gets a single job by workflow ID and step ID
Examples
iex> get_job(123)
%Job{}
iex> get_job(456)
nil
Gets a single job by workflow ID and step ID
Examples
iex> get_job(123)
%Job{}
iex> get_job(456)
nil
Gets a single job.
Examples
iex> get_job(123)
%Job{}
iex> get_job(456)
nil
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)
Gets a single job with its related status.
Raises Ecto.NoResultsError
if the Job does not exist.
Examples
iex> get_job_with_status!(123)
%Job{}
iex> get_job!(456)
** (Ecto.NoResultsError)
Returns the list of jobs pending"
Returns the list of jobs pending"
Returns the list of jobs.
Examples
iex> list_jobs()
[%Job{}, ...]
Set skipped status to all queued jobs.
Examples
iex> skip_jobs(workflow, step_id, "download_http")
:ok
Updates a job.
Examples
iex> update_job(job, %{field: new_value})
{:ok, %Job{}}
iex> update_job(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}