View Source StepFlow.Jobs (StepFlow v1.7.0)
The Jobs context.
Link to this section 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.
Set skipped status to all queued jobs.
Updates a job.
Link to this section Functions
Returns an %Ecto.Changeset{}
for tracking job changes.
examples
Examples
iex> change_job(job)
%Ecto.Changeset{source: %Job{}}
Creates a job with a completed status.
examples
Examples
iex> create_completed_job(workflow, step_id, "webhook_notification")
{:ok, "completed"}
Creates a job with an error status.
examples
Examples
iex> create_error_job(workflow, step_id, "download_http", "unsupported step")
{:ok, "created"}
Creates a job.
examples
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
Examples
iex> create_paused_job(workflow, 1, "download_http")
{:ok, "paused"}
Creates a job with a skipped status.
examples
Examples
iex> create_skipped_job(workflow, 1, "download_http")
{:ok, "skipped"}
Deletes a Job.
examples
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
Examples
iex> get_job(123)
%Job{}
iex> get_job(456)
nil
Gets a single job by workflow ID and step ID
examples
Examples
iex> get_job(123)
%Job{}
iex> get_job(456)
nil
Gets a single job.
examples
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
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
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.
examples
Examples
iex> list_jobs()
[%Job{}, ...]
Set skipped status to all queued jobs.
examples
Examples
iex> skip_jobs(workflow, step_id, "download_http")
:ok
Updates a job.
examples
Examples
iex> update_job(job, %{field: new_value})
{:ok, %Job{}}
iex> update_job(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}