View Source WorkflowMetal.Workitem.Supervisor (workflow_metal v0.2.1)

DynamicSupervisor to supervise all workitems of a workflow.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Open a workitem(`:gen_statem').

Lock tokens before a workitem execution.

Link to this section Types

Specs

application() :: WorkflowMetal.Application.t()

Specs

Specs

Specs

workitem_id() :: WorkflowMetal.Storage.Schema.Workitem.id()

Specs

workitem_output() :: WorkflowMetal.Storage.Schema.Workitem.output()

Specs

workitem_schema() :: WorkflowMetal.Storage.Schema.Workitem.t()

Link to this section Functions

Link to this function

abandon_workitem(application, workitem_id)

View Source

Specs

abandon_workitem(application(), workitem_id()) ::
  WorkflowMetal.Workitem.Workitem.on_abandon()
  | {:error, :workitem_not_found}
  | {:error, :workitem_not_available}

Abandon a workitem.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

complete_workitem(application, workitem_id, output)

View Source

Specs

complete_workitem(application(), workitem_id(), workitem_output()) ::
  WorkflowMetal.Workitem.Workitem.on_complete()
  | {:error, :workitem_not_found}
  | {:error, :workitem_not_available}

Complete a workitem.

Link to this function

open_workitem(application, workitem_schema)

View Source

Specs

open_workitem(application(), workitem_schema() | workitem_id()) ::
  WorkflowMetal.Registration.Adapter.on_start_child()
  | {:error, :workitem_not_found}

Open a workitem(`:gen_statem').

Link to this function

preexecute(application, workitem_id)

View Source

Specs

preexecute(application(), workitem_id()) ::
  WorkflowMetal.Task.Task.on_preexecute()
  | {:error, :workitem_not_found}
  | {:error, :task_not_available}

Lock tokens before a workitem execution.