Documentation
¶
Overview ¶
Package workflows defines the workflows a process is carried out by, each a sequence of the tasks in the tasks packages.
Index ¶
- type Registrar
- type Workflows
- func (a *Workflows) CompleteProcess(ctx context.Context, executionContext *execution.Context, processID string) (*execution.Context, error)
- func (w *Workflows) HandleBatchJobCompletion(ctx workflow.Context, processID string) error
- func (w *Workflows) HandleBatchJobSubmission(ctx workflow.Context, processID string) error
- func (w *Workflows) RecordWorkflowStatus(ctx context.Context, processID, workflowID string, ...) error
- func (w *Workflows) Register(r Registrar) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registrar ¶
type Registrar interface {
RegisterWorkflow(wf workflow.Workflow, opts ...registry.RegisterOption) error
RegisterActivity(a workflow.Activity, opts ...registry.RegisterOption) error
}
Registrar is where the workflows and the activities they run are registered: worker.WorkflowOrchestrator in the server, a test registry elsewhere.
type Workflows ¶
type Workflows struct {
// contains filtered or unexported fields
}
Workflows holds the workflows of a process and the tasks they run.
func New ¶
func New(data *data.Tasks, batch *batch.Tasks, monitoring *monitoring.Tasks, dataStagingTasks *processrepo.DataStagingTaskRepository, jobSubmissionTasks *processrepo.JobSubmissionTaskRepository, jobMonitoringTasks *processrepo.JobMonitoringTaskRepository, processStatus *processrepo.StatusRepository, processWorkflows *processrepo.WorkflowRepository, ) *Workflows
New returns the workflows over the given tasks and the repositories they are planned from.
func (*Workflows) CompleteProcess ¶
func (a *Workflows) CompleteProcess(ctx context.Context, executionContext *execution.Context, processID string) (*execution.Context, error)
CompleteProcess is the last activity of the completion workflow: it marks the process complete once its outputs are staged.
func (*Workflows) HandleBatchJobCompletion ¶
HandleBatchJobCompletion runs once the scheduler reports a job finished: it checks the job's outcome, stages its outputs back and marks the process complete.
func (*Workflows) HandleBatchJobSubmission ¶
HandleBatchJobSubmission stages a process's inputs onto its cluster and submits the job. This is an async call and will not block the caller.
func (*Workflows) RecordWorkflowStatus ¶
func (w *Workflows) RecordWorkflowStatus(ctx context.Context, processID, workflowID string, workflowType model.ProcessWorkflowType, status model.ProcessWorkflowStatusType) error
RecordWorkflowStatus is the activity behind recordStatus. The write is an activity rather than workflow code so that a replay reads its result from history instead of writing again.