Documentation
¶
Index ¶
- func WaitForWorkflowCompletionUntilTimeout(executionChannel WorkflowExecutionChannel, timeout time.Duration) (workflow *model.Workflow, err error)
- type RunningWorkflow
- type WorkflowExecutionChannel
- type WorkflowExecutor
- func (e *WorkflowExecutor) DeleteQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)
- func (e *WorkflowExecutor) DeleteQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (*http.Response, error)
- func (e *WorkflowExecutor) ExecuteWorkflow(startWorkflowRequest *model.StartWorkflowRequest, waitUntilTask string) (run *model.WorkflowRun, err error)
- func (e *WorkflowExecutor) ExecuteWorkflowWithContext(ctx context.Context, startWorkflowRequest *model.StartWorkflowRequest, ...) (run *model.WorkflowRun, err error)
- func (e *WorkflowExecutor) GetByCorrelationIds(workflowName string, includeClosed bool, includeTasks bool, ...) (map[string][]model.Workflow, error)
- func (e *WorkflowExecutor) GetByCorrelationIdsAndNames(includeClosed bool, includeTasks bool, correlationIds []string, ...) (map[string][]model.Workflow, error)
- func (e *WorkflowExecutor) GetByCorrelationIdsAndNamesWithContext(ctx context.Context, includeClosed bool, includeTasks bool, ...) (map[string][]model.Workflow, error)
- func (e *WorkflowExecutor) GetByCorrelationIdsWithContext(ctx context.Context, workflowName string, includeClosed bool, ...) (map[string][]model.Workflow, error)
- func (e *WorkflowExecutor) GetQueueConfiguration(queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)
- func (e *WorkflowExecutor) GetQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)
- func (e *WorkflowExecutor) GetTask(taskId string) (task *model.Task, err error)
- func (e *WorkflowExecutor) GetTaskWithContext(ctx context.Context, taskId string) (task *model.Task, err error)
- func (e *WorkflowExecutor) GetWorkflow(workflowId string, includeTasks bool) (*model.Workflow, error)
- func (e *WorkflowExecutor) GetWorkflowStatus(workflowId string, includeOutput bool, includeVariables bool) (*model.WorkflowState, error)
- func (e *WorkflowExecutor) GetWorkflowStatusWithContext(ctx context.Context, workflowId string, includeOutput bool, ...) (*model.WorkflowState, error)
- func (e *WorkflowExecutor) GetWorkflowWithContext(ctx context.Context, workflowId string, includeTasks bool) (*model.Workflow, error)
- func (e *WorkflowExecutor) MonitorExecution(workflowId string) (workflowMonitor WorkflowExecutionChannel, err error)
- func (e *WorkflowExecutor) Pause(workflowId string) error
- func (e *WorkflowExecutor) PauseWithContext(ctx context.Context, workflowId string) error
- func (e *WorkflowExecutor) PutQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)
- func (e *WorkflowExecutor) PutQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (*http.Response, error)
- func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)
- func (e *WorkflowExecutor) ReRunWithContext(ctx context.Context, workflowId string, ...) (id string, error error)
- func (e *WorkflowExecutor) RegisterWorkflow(overwrite bool, workflow *model.WorkflowDef) error
- func (e *WorkflowExecutor) RegisterWorkflowWithContext(ctx context.Context, overwrite bool, workflow *model.WorkflowDef) error
- func (e *WorkflowExecutor) RemoveWorkflow(workflowId string) error
- func (e *WorkflowExecutor) RemoveWorkflowWithContext(ctx context.Context, workflowId string) error
- func (e *WorkflowExecutor) Restart(workflowId string, useLatestDefinition bool) error
- func (e *WorkflowExecutor) RestartWithContext(ctx context.Context, workflowId string, useLatestDefinition bool) error
- func (e *WorkflowExecutor) Resume(workflowId string) error
- func (e *WorkflowExecutor) ResumeWithContext(ctx context.Context, workflowId string) error
- func (e *WorkflowExecutor) Retry(workflowId string, resumeSubworkflowTasks bool) error
- func (e *WorkflowExecutor) RetryWithContext(ctx context.Context, workflowId string, resumeSubworkflowTasks bool) error
- func (e *WorkflowExecutor) Search(start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error)
- func (e *WorkflowExecutor) SearchWithContext(ctx context.Context, start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error)
- func (e *WorkflowExecutor) SkipTasksFromWorkflow(workflowId string, taskReferenceName string, ...) error
- func (e *WorkflowExecutor) SkipTasksFromWorkflowWithContext(ctx context.Context, workflowId string, taskReferenceName string, ...) error
- func (e *WorkflowExecutor) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)
- func (e *WorkflowExecutor) StartWorkflowWithContext(ctx context.Context, startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)
- func (e *WorkflowExecutor) StartWorkflows(monitorExecution bool, startWorkflowRequests ...*model.StartWorkflowRequest) []*RunningWorkflow
- func (e *WorkflowExecutor) Terminate(workflowId string, reason string) error
- func (e *WorkflowExecutor) TerminateWithContext(ctx context.Context, workflowId string, reason string) error
- func (e *WorkflowExecutor) TerminateWithFailure(workflowId string, reason string, triggerFailureWorkflow bool) error
- func (e *WorkflowExecutor) TerminateWithFailureWithContext(ctx context.Context, workflowId string, reason string, ...) error
- func (e *WorkflowExecutor) UnRegisterWorkflow(name string, version int32) error
- func (e *WorkflowExecutor) UnRegisterWorkflowWithContext(ctx context.Context, name string, version int32) error
- func (e *WorkflowExecutor) UpdateTask(taskId string, workflowInstanceId string, status model.TaskResultStatus, ...) error
- func (e *WorkflowExecutor) UpdateTaskByRefName(taskRefName string, workflowInstanceId string, status model.TaskResultStatus, ...) error
- func (e *WorkflowExecutor) UpdateTaskByRefNameWithContext(ctx context.Context, taskRefName string, workflowInstanceId string, ...) error
- func (e *WorkflowExecutor) UpdateTaskWithContext(ctx context.Context, taskId string, workflowInstanceId string, ...) error
- func (e *WorkflowExecutor) WaitForRunningWorkflowsUntilTimeout(timeout time.Duration, runningWorkflows ...*RunningWorkflow)
- type WorkflowMonitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitForWorkflowCompletionUntilTimeout ¶
func WaitForWorkflowCompletionUntilTimeout(executionChannel WorkflowExecutionChannel, timeout time.Duration) (workflow *model.Workflow, err error)
WaitForWorkflowCompletionUntilTimeout Helper method to wait on the channel until the timeout for the workflow execution to complete
Types ¶
type RunningWorkflow ¶
type RunningWorkflow struct { WorkflowId string WorkflowExecutionChannel WorkflowExecutionChannel Err error CompletedWorkflow *model.Workflow }
func NewRunningWorkflow ¶
func NewRunningWorkflow(workflowId string, workflowExecutionChannel WorkflowExecutionChannel, err error) *RunningWorkflow
func (*RunningWorkflow) WaitForCompletionUntilTimeout ¶ added in v1.2.4
type WorkflowExecutor ¶
type WorkflowExecutor struct {
// contains filtered or unexported fields
}
func NewWorkflowExecutor ¶
func NewWorkflowExecutor(apiClient *client.APIClient) *WorkflowExecutor
NewWorkflowExecutor Create a new workflow executor
func (*WorkflowExecutor) DeleteQueueConfiguration ¶ added in v1.2.13
func (e *WorkflowExecutor) DeleteQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)
DeleteQueueConfiguration Delete queue configuration permanently from the system Returns nil if no error occurred
func (*WorkflowExecutor) DeleteQueueConfigurationWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) DeleteQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (*http.Response, error)
func (*WorkflowExecutor) ExecuteWorkflow ¶ added in v1.2.15
func (e *WorkflowExecutor) ExecuteWorkflow(startWorkflowRequest *model.StartWorkflowRequest, waitUntilTask string) (run *model.WorkflowRun, err error)
ExecuteWorkflow start a workflow and wait until the workflow completes or the waitUntilTask completes Returns the output of the workflow
func (*WorkflowExecutor) ExecuteWorkflowWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) ExecuteWorkflowWithContext(ctx context.Context, startWorkflowRequest *model.StartWorkflowRequest, waitUntilTask string) (run *model.WorkflowRun, err error)
func (*WorkflowExecutor) GetByCorrelationIds ¶
func (e *WorkflowExecutor) GetByCorrelationIds(workflowName string, includeClosed bool, includeTasks bool, correlationIds ...string) (map[string][]model.Workflow, error)
GetByCorrelationIds Given the list of correlation ids, find and return workflows Returns a map with key as correlationId and value as a list of Workflows When IncludeClosed is set to true, the return value also includes workflows that are completed otherwise only running workflows are returned
func (*WorkflowExecutor) GetByCorrelationIdsAndNames ¶ added in v1.2.17
func (e *WorkflowExecutor) GetByCorrelationIdsAndNames(includeClosed bool, includeTasks bool, correlationIds []string, workflowNames []string) (map[string][]model.Workflow, error)
GetByCorrelationIdsAndNames Given the list of correlation ids and list of workflow names, find and return workflows Returns a map with key as correlationId and value as a list of Workflows When IncludeClosed is set to true, the return value also includes workflows that are completed otherwise only running workflows are returned
func (*WorkflowExecutor) GetByCorrelationIdsAndNamesWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) GetByCorrelationIdsWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) GetQueueConfiguration ¶ added in v1.2.13
func (e *WorkflowExecutor) GetQueueConfiguration(queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)
GetQueueConfiguration Get queue configuration if present Returns queue configuration if present
func (*WorkflowExecutor) GetQueueConfigurationWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) GetQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)
func (*WorkflowExecutor) GetTask ¶
func (e *WorkflowExecutor) GetTask(taskId string) (task *model.Task, err error)
GetTask by task Id returns nil if no such task is found by the id
func (*WorkflowExecutor) GetTaskWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) GetWorkflow ¶
func (e *WorkflowExecutor) GetWorkflow(workflowId string, includeTasks bool) (*model.Workflow, error)
GetWorkflow Get workflow execution by workflow Id. If includeTasks is set, also fetches all the task details. Returns nil if no workflow is found by the id
func (*WorkflowExecutor) GetWorkflowStatus ¶
func (e *WorkflowExecutor) GetWorkflowStatus(workflowId string, includeOutput bool, includeVariables bool) (*model.WorkflowState, error)
GetWorkflowStatus Get the status of the workflow execution. This is a lightweight method that returns only overall state of the workflow
func (*WorkflowExecutor) GetWorkflowStatusWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) GetWorkflowStatusWithContext(ctx context.Context, workflowId string, includeOutput bool, includeVariables bool) (*model.WorkflowState, error)
func (*WorkflowExecutor) GetWorkflowWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) MonitorExecution ¶
func (e *WorkflowExecutor) MonitorExecution(workflowId string) (workflowMonitor WorkflowExecutionChannel, err error)
MonitorExecution monitors the workflow execution Returns the channel with the execution result of the workflow Note: Channels will continue to grow if the workflows do not complete and/or are not taken out
func (*WorkflowExecutor) Pause ¶
func (e *WorkflowExecutor) Pause(workflowId string) error
Pause the execution of a running workflow. Any tasks that are currently running will finish but no new tasks are scheduled until the workflow is resumed
func (*WorkflowExecutor) PauseWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) PauseWithContext(ctx context.Context, workflowId string) error
func (*WorkflowExecutor) PutQueueConfiguration ¶ added in v1.2.13
func (e *WorkflowExecutor) PutQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)
PutQueueConfiguration Create or update a queue configuration Returns nil if no error occurred
func (*WorkflowExecutor) PutQueueConfigurationWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) PutQueueConfigurationWithContext(ctx context.Context, queueConfiguration queue.QueueConfiguration) (*http.Response, error)
func (*WorkflowExecutor) ReRun ¶
func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)
ReRun a completed workflow from a specific task (ReRunFromTaskId) and optionally change the input Also update the completed tasks with new input (ReRunFromTaskId) if required
func (*WorkflowExecutor) ReRunWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) ReRunWithContext(ctx context.Context, workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)
func (*WorkflowExecutor) RegisterWorkflow ¶
func (e *WorkflowExecutor) RegisterWorkflow(overwrite bool, workflow *model.WorkflowDef) error
RegisterWorkflow Registers the workflow on the server. Overwrites if the flag is set. If the 'overwrite' flag is not set and the workflow definition differs from the one on the server, the call will fail with response code 409
func (*WorkflowExecutor) RegisterWorkflowWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) RegisterWorkflowWithContext(ctx context.Context, overwrite bool, workflow *model.WorkflowDef) error
func (*WorkflowExecutor) RemoveWorkflow ¶ added in v1.2.10
func (e *WorkflowExecutor) RemoveWorkflow(workflowId string) error
RemoveWorkflow Remove workflow execution permanently from the system Returns nil if no workflow is found by the id
func (*WorkflowExecutor) RemoveWorkflowWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) RemoveWorkflowWithContext(ctx context.Context, workflowId string) error
func (*WorkflowExecutor) Restart ¶
func (e *WorkflowExecutor) Restart(workflowId string, useLatestDefinition bool) error
Restart a workflow execution from the beginning with the same input. When called on a workflow that is not in a terminal status, this operation has no effect If useLatestDefinition is set, the restarted workflow fetches the latest definition from the metadata store
func (*WorkflowExecutor) RestartWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) Resume ¶
func (e *WorkflowExecutor) Resume(workflowId string) error
Resume the execution of a workflow that is paused. If the workflow is not paused, this method has no effect
func (*WorkflowExecutor) ResumeWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) ResumeWithContext(ctx context.Context, workflowId string) error
func (*WorkflowExecutor) Retry ¶
func (e *WorkflowExecutor) Retry(workflowId string, resumeSubworkflowTasks bool) error
Retry a failed workflow from the last task that failed. When called the task in the failed state is scheduled again and workflow moves to RUNNING status. If resumeSubworkflowTasks is set and the last failed task was a sub-workflow the server restarts the subworkflow from the failed task. If set to false, the sub-workflow is re-executed.
func (*WorkflowExecutor) RetryWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) Search ¶
func (e *WorkflowExecutor) Search(start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error)
Search searches for workflows
- Start: Start index - used for pagination
- Size: Number of results to return
- Query: Query expression. In the format FIELD = 'VALUE' or FIELD IN (value1, value2) Only AND operations are supported. e.g. workflowId IN ('a', 'b', 'c') ADN workflowType ='test_workflow' AND startTime BETWEEN 1000 and 2000 Supported fields for Query are:workflowId,workflowType,status,startTime
- FreeText: Full text search. All the workflow input, output and task outputs upto certain limit (check with your admins to find the size limit) are full text indexed and can be used to search
func (*WorkflowExecutor) SearchWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) SearchWithContext(ctx context.Context, start int32, size int32, query string, freeText string) ([]model.WorkflowSummary, error)
func (*WorkflowExecutor) SkipTasksFromWorkflow ¶
func (e *WorkflowExecutor) SkipTasksFromWorkflow(workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest) error
SkipTasksFromWorkflow Skips a given task execution from a current running workflow. When skipped the task's input and outputs are updated from skipTaskRequest parameter.
func (*WorkflowExecutor) SkipTasksFromWorkflowWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) SkipTasksFromWorkflowWithContext(ctx context.Context, workflowId string, taskReferenceName string, skipTaskRequest model.SkipTaskRequest) error
func (*WorkflowExecutor) StartWorkflow ¶
func (e *WorkflowExecutor) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)
StartWorkflow Start workflows Returns the id of the newly created workflow
func (*WorkflowExecutor) StartWorkflowWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) StartWorkflowWithContext(ctx context.Context, startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)
func (*WorkflowExecutor) StartWorkflows ¶
func (e *WorkflowExecutor) StartWorkflows(monitorExecution bool, startWorkflowRequests ...*model.StartWorkflowRequest) []*RunningWorkflow
StartWorkflows Start workflows in bulk Returns RunningWorkflow struct that contains the workflowId, Err (if failed to start) and an execution channel which can be used to monitor the completion of the workflow execution. The channel is available if monitorExecution is set
func (*WorkflowExecutor) Terminate ¶
func (e *WorkflowExecutor) Terminate(workflowId string, reason string) error
Terminate Terminates a running workflow. Reason must be provided that is captured as the termination reason for the workflow.
func (*WorkflowExecutor) TerminateWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) TerminateWithFailure ¶ added in v1.2.18
func (e *WorkflowExecutor) TerminateWithFailure(workflowId string, reason string, triggerFailureWorkflow bool) error
TerminateWithFailure Terminates a running workflow.
func (*WorkflowExecutor) TerminateWithFailureWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) UnRegisterWorkflow ¶ added in v1.3.5
func (e *WorkflowExecutor) UnRegisterWorkflow(name string, version int32) error
UnRegisterWorkflow Un-registers the workflow on the server.
func (*WorkflowExecutor) UnRegisterWorkflowWithContext ¶ added in v1.5.0
func (*WorkflowExecutor) UpdateTask ¶
func (e *WorkflowExecutor) UpdateTask(taskId string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error
UpdateTask update the task with output and status.
func (*WorkflowExecutor) UpdateTaskByRefName ¶
func (e *WorkflowExecutor) UpdateTaskByRefName(taskRefName string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error
UpdateTaskByRefName Update the execution status and output of the task and status
func (*WorkflowExecutor) UpdateTaskByRefNameWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) UpdateTaskByRefNameWithContext(ctx context.Context, taskRefName string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error
func (*WorkflowExecutor) UpdateTaskWithContext ¶ added in v1.5.0
func (e *WorkflowExecutor) UpdateTaskWithContext(ctx context.Context, taskId string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error
func (*WorkflowExecutor) WaitForRunningWorkflowsUntilTimeout ¶ added in v1.2.6
func (e *WorkflowExecutor) WaitForRunningWorkflowsUntilTimeout(timeout time.Duration, runningWorkflows ...*RunningWorkflow)
WaitForRunningWorkflowsUntilTimeout Helper method to wait for running workflows until the timeout for the workflow execution to complete
type WorkflowMonitor ¶
type WorkflowMonitor struct {
// contains filtered or unexported fields
}
func NewWorkflowMonitor ¶
func NewWorkflowMonitor(workflowClient *client.WorkflowResourceApiService) *WorkflowMonitor