View Source WorkflowMetal.Case.Supervisor (workflow_metal v0.2.1)
DynamicSupervisor
to supervise all case of a workflow.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
consume tokens that locked by the task
Fetch tokens that locked by the task.
Issue tokens after a task completion.
Lock tokens for the task.
Open a case(`GenServer').
Request :free
and :locked
(locked by the task) tokens which should offer to the task.
Terminate a case(`GenServer').
Free tokens that locked by the task.
Link to this section Types
Specs
application() :: WorkflowMetal.Application.t()
Specs
case_id() :: WorkflowMetal.Storage.Schema.Case.id()
Specs
case_schema() :: WorkflowMetal.Storage.Schema.Case.t()
Specs
task_id() :: WorkflowMetal.Storage.Schema.Task.id()
Specs
token_id() :: WorkflowMetal.Storage.Schema.Token.id()
Specs
token_schema() :: WorkflowMetal.Storage.Schema.Token.t()
Specs
workflow_id() :: WorkflowMetal.Storage.Schema.Workflow.id()
Specs
workflow_identifier() :: WorkflowMetal.Workflow.Supervisor.workflow_identifier()
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
consume_tokens(application(), case_id(), task_id()) :: {:ok, [token_schema(), ...]} | {:error, :tokens_not_available} | {:error, :case_not_found}
consume tokens that locked by the task
This usually happens after a task execution.
Specs
fetch_locked_tokens(application(), case_id(), task_id()) :: {:ok, [token_schema()]} | {:error, :case_not_available} | {:error, :case_not_found}
Fetch tokens that locked by the task.
This usually happens when a task is starting.
Specs
issue_tokens(application(), case_id(), [token_schema(), ...]) :: {:ok, [token_schema(), ...]} | {:error, :case_not_found}
Issue tokens after a task completion.
Specs
lock_tokens(application(), case_id(), [token_id(), ...], task_id()) :: {:ok, [token_schema(), ...]} | {:error, :tokens_not_available} | {:error, :case_not_found}
Lock tokens for the task.
This usually happens before a workitem execution.
Specs
open_case(application(), case_id()) :: WorkflowMetal.Registration.Adapter.on_start_child() | {:error, :case_not_found} | {:error, :workflow_not_found}
Open a case(`GenServer').
Specs
request_tokens(application(), case_id(), task_id()) :: {:ok, [token_schema()]} | {:error, :case_not_found}
Request :free
and :locked
(locked by the task) tokens which should offer to the task.
This usually happens after a task restore from the storage.
Specs
terminate_case(application(), case_id()) :: :ok | {:error, :case_not_found} | {:error, :workflow_not_found}
Terminate a case(`GenServer').
Specs
unlock_tokens(application(), case_id(), task_id()) :: :ok | {:error, :case_not_available} | {:error, :case_not_found}
Free tokens that locked by the task.
This usually happens afetr a task has been abandoned.