workflow

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JavascriptEvaluator = "javascript"
)

Variables

This section is empty.

Functions

func WaitForWorkflowCompletionUntilTimeout

func WaitForWorkflowCompletionUntilTimeout(runningChannel RunningWorkflowChannel, 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 CustomTask added in v1.5.0

type CustomTask struct {
	WorkflowTaskBuilder
}

func NewCustomTask added in v1.5.0

func NewCustomTask(taskType string, taskRefName string) *CustomTask

func (*CustomTask) Description added in v1.5.0

func (task *CustomTask) Description(description string) *CustomTask

Description of the task

func (*CustomTask) Input added in v1.5.0

func (task *CustomTask) Input(key string, value interface{}) *CustomTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*CustomTask) InputMap added in v1.5.0

func (task *CustomTask) InputMap(inputMap map[string]interface{}) *CustomTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*CustomTask) Optional added in v1.5.0

func (task *CustomTask) Optional(optional bool) *CustomTask

Optional if set to true, the task will not fail the workflow if the task fails

type DoWhileTask

type DoWhileTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

DoWhileTask Do...While task

func NewDoWhileTask

func NewDoWhileTask(taskRefName string, terminationCondition string, tasks ...IWorkflowTask) *DoWhileTask

NewDoWhileTask DoWhileTask Crate a new DoWhile task. terminationCondition is a Javascript expression that evaluates to True or False

func NewLoopTask

func NewLoopTask(taskRefName string, iterations int32, tasks ...IWorkflowTask) *DoWhileTask

NewLoopTask Loop over N times when N is specified as iterations

func (*DoWhileTask) Description

func (task *DoWhileTask) Description(description string) *DoWhileTask

Description of the task

func (*DoWhileTask) Input

func (task *DoWhileTask) Input(key string, value interface{}) *DoWhileTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*DoWhileTask) InputMap

func (task *DoWhileTask) InputMap(inputMap map[string]interface{}) *DoWhileTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*DoWhileTask) Optional

func (task *DoWhileTask) Optional(optional bool) *DoWhileTask

Optional if set to true, the task will not fail the workflow if the task fails

type DynamicForkInput

type DynamicForkInput struct {
	Tasks     []model.WorkflowTask
	TaskInput map[string]interface{}
}

DynamicForkInput struct that represents the output of the dynamic fork preparatory task

DynamicFork requires inputs that specifies the list of tasks to be executed in parallel along with the inputs to each of these tasks. This usually means having another task before the dynamic task whose output contains the tasks to be forked.

This struct represents the output of such a task

type DynamicForkTask

type DynamicForkTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

func NewDynamicForkTask

func NewDynamicForkTask(taskRefName string, forkPrepareTask IWorkflowTask) *DynamicForkTask

func NewDynamicForkTaskWithoutPrepareTask

func NewDynamicForkTaskWithoutPrepareTask(taskRefName string) *DynamicForkTask

func NewDynamicForkWithJoinTask

func NewDynamicForkWithJoinTask(taskRefName string, forkPrepareTask IWorkflowTask, join JoinTask) *DynamicForkTask

func (*DynamicForkTask) Description

func (task *DynamicForkTask) Description(description string) *DynamicForkTask

Description of the task

func (*DynamicForkTask) Input

func (task *DynamicForkTask) Input(key string, value interface{}) *DynamicForkTask

Input to the task

func (*DynamicForkTask) InputMap

func (task *DynamicForkTask) InputMap(inputMap map[string]interface{}) *DynamicForkTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*DynamicForkTask) Optional

func (task *DynamicForkTask) Optional(optional bool) *DynamicForkTask

Optional if set to true, the task will not fail the workflow if the task fails

type DynamicTask

type DynamicTask struct {
	WorkflowTaskBuilder
}

func NewDynamicTask

func NewDynamicTask(taskRefName string, taskNameParameter string) *DynamicTask

NewDynamicTask

  • taskRefName Reference name for the task. MUST be unique within the workflow
  • taskNameParameter Parameter that contains the expression for the dynamic task name. e.g. ${workflow.input.dynamicTask}

func (*DynamicTask) Description

func (task *DynamicTask) Description(description string) *DynamicTask

Description of the task

func (*DynamicTask) Input

func (task *DynamicTask) Input(key string, value interface{}) *DynamicTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*DynamicTask) InputMap

func (task *DynamicTask) InputMap(inputMap map[string]interface{}) *DynamicTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*DynamicTask) Optional

func (task *DynamicTask) Optional(optional bool) *DynamicTask

Optional if set to true, the task will not fail the workflow if the task fails

type EventTask

type EventTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

EventTask Task to publish Events to external queuing systems like SQS, NATS, AMQP etc.

func NewConductorEventTask

func NewConductorEventTask(taskRefName string, eventName string) *EventTask

func NewSqsEventTask

func NewSqsEventTask(taskRefName string, queueName string) *EventTask

func (*EventTask) Description

func (task *EventTask) Description(description string) *EventTask

Description of the task

func (*EventTask) Input

func (task *EventTask) Input(key string, value interface{}) *EventTask

Input to the task

func (*EventTask) InputMap

func (task *EventTask) InputMap(inputMap map[string]interface{}) *EventTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*EventTask) Optional

func (task *EventTask) Optional(optional bool) *EventTask

Optional if set to true, the task will not fail the workflow if the task fails

type ForkTask

type ForkTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

func NewForkTask

func NewForkTask(taskRefName string, forkedTask ...[]IWorkflowTask) *ForkTask

NewForkTask creates a new fork task that executes the given tasks in parallel *

  • execute task specified in the forkedTasks parameter in parallel. *
  • <p>forkedTask is a two-dimensional list that executes the outermost list in parallel and list
  • within that is executed sequentially. *
  • <p>e.g. [[task1, task2],[task3, task4],[task5]] are executed as: *
  • <pre>
  • ---------------
  • | fork |
  • ---------------
  • | | |
  • | | |
  • task1 task3 task5
  • task2 task4 |
  • | | |
  • ---------------------
  • | join |
  • ---------------------
  • </pre> * *

func NewForkTaskWithJoin

func NewForkTaskWithJoin(taskRefName string, join *JoinTask, forkedTask ...[]IWorkflowTask) *ForkTask

func (*ForkTask) Description

func (task *ForkTask) Description(description string) *ForkTask

Description of the task

func (*ForkTask) Input

func (task *ForkTask) Input(key string, value interface{}) *ForkTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*ForkTask) InputMap

func (task *ForkTask) InputMap(inputMap map[string]interface{}) *ForkTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*ForkTask) Optional

func (task *ForkTask) Optional(optional bool) *ForkTask

Optional if set to true, the task will not fail the workflow if one of the loop task fails

type HttpInput

type HttpInput struct {
	Method            HttpMethod          `json:"method"`
	Uri               string              `json:"uri"`
	Headers           map[string][]string `json:"headers,omitempty"`
	Accept            string              `json:"accept,omitempty"`
	ContentType       string              `json:"contentType,omitempty"`
	ConnectionTimeOut int16               `json:"ConnectionTimeOut,omitempty"`
	ReadTimeout       int16               `json:"readTimeout,omitempty"`
	Body              interface{}         `json:"body,omitempty"`
}

HttpInput Input to the HTTP task

type HttpMethod

type HttpMethod string
const (
	GET     HttpMethod = "GET"
	PUT     HttpMethod = "PUT"
	POST    HttpMethod = "POST"
	DELETE  HttpMethod = "DELETE"
	HEAD    HttpMethod = "HEAD"
	OPTIONS HttpMethod = "OPTIONS"
)

type HttpTask

type HttpTask struct {
	WorkflowTaskBuilder
}

func NewHttpTask

func NewHttpTask(taskRefName string, input *HttpInput) *HttpTask

NewHttpTask Create a new HTTP Task

func (*HttpTask) Description

func (task *HttpTask) Description(description string) *HttpTask

Description of the task

func (*HttpTask) Input

func (task *HttpTask) Input(key string, value interface{}) *HttpTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*HttpTask) InputMap

func (task *HttpTask) InputMap(inputMap map[string]interface{}) *HttpTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*HttpTask) Optional

func (task *HttpTask) Optional(optional bool) *HttpTask

Optional if set to true, the task will not fail the workflow if the task fails

type HumanTask

type HumanTask struct {
	WorkflowTaskBuilder
}

func NewHumanTask

func NewHumanTask(taskRefName string) *HumanTask

func (*HumanTask) Description

func (task *HumanTask) Description(description string) *HumanTask

Description of the task

func (*HumanTask) Input

func (task *HumanTask) Input(key string, value interface{}) *HumanTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*HumanTask) InputMap

func (task *HumanTask) InputMap(inputMap map[string]interface{}) *HumanTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*HumanTask) Optional

func (task *HumanTask) Optional(optional bool) *HumanTask

Optional if set to true, the task will not fail the workflow if the task fails

type IWorkflowTask added in v1.5.0

type IWorkflowTask interface {
	ToTaskDef() *model.TaskDef
	OutputRef(path string) string
	// contains filtered or unexported methods
}

type InlineTask

type InlineTask struct {
	WorkflowTaskBuilder
}

func NewInlineGraalJSTask

func NewInlineGraalJSTask(name string, script string) *InlineTask

NewInlineGraalJSTask An inline task with that executes the given javascript. Uses GraalVM for faster execution

func NewInlineTask

func NewInlineTask(name string, script string) *InlineTask

NewInlineTask An inline task with that executes the given javascript Legacy -- please use NewInlineGraalJSTask which provides better performance

func (*InlineTask) Description

func (task *InlineTask) Description(description string) *InlineTask

Description of the task

func (*InlineTask) Input

func (task *InlineTask) Input(key string, value interface{}) *InlineTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*InlineTask) InputMap

func (task *InlineTask) InputMap(inputMap map[string]interface{}) *InlineTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*InlineTask) Optional

func (task *InlineTask) Optional(optional bool) *InlineTask

Optional if set to true, the task will not fail the workflow if the task fails

type JQTask

type JQTask struct {
	WorkflowTaskBuilder
}

func NewJQTask

func NewJQTask(name string, script string) *JQTask

func (*JQTask) Description

func (task *JQTask) Description(description string) *JQTask

Description of the task

func (*JQTask) Input

func (task *JQTask) Input(key string, value interface{}) *JQTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*JQTask) InputMap

func (task *JQTask) InputMap(inputMap map[string]interface{}) *JQTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*JQTask) Optional

func (task *JQTask) Optional(optional bool) *JQTask

Optional if set to true, the task will not fail the workflow if the task fails

type JoinTask

type JoinTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

func NewJoinTask

func NewJoinTask(taskRefName string, joinOn ...string) *JoinTask

func (*JoinTask) Description

func (task *JoinTask) Description(description string) *JoinTask

Description of the task

func (*JoinTask) Optional

func (task *JoinTask) Optional(optional bool) *JoinTask

Optional if set to true, the task will not fail the workflow if the task fails

type KafkaPublishTask

type KafkaPublishTask struct {
	WorkflowTaskBuilder
}

func NewKafkaPublishTask

func NewKafkaPublishTask(taskRefName string, kafkaPublishTaskInput *KafkaPublishTaskInput) *KafkaPublishTask

func (*KafkaPublishTask) Description

func (task *KafkaPublishTask) Description(description string) *KafkaPublishTask

Description of the task

func (*KafkaPublishTask) Input

func (task *KafkaPublishTask) Input(key string, value interface{}) *KafkaPublishTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*KafkaPublishTask) InputMap

func (task *KafkaPublishTask) InputMap(inputMap map[string]interface{}) *KafkaPublishTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*KafkaPublishTask) Optional

func (task *KafkaPublishTask) Optional(optional bool) *KafkaPublishTask

Optional if set to true, the task will not fail the workflow if the task fails

type KafkaPublishTaskInput

type KafkaPublishTaskInput struct {
	BootStrapServers string                 `json:"bootStrapServers"`
	Key              string                 `json:"key"`
	KeySerializer    string                 `json:"keySerializer,omitempty"`
	Value            string                 `json:"value"`
	RequestTimeoutMs string                 `json:"requestTimeoutMs,omitempty"`
	MaxBlockMs       string                 `json:"maxBlockMs,omitempty"`
	Headers          map[string]interface{} `json:"headers,omitempty"`
	Topic            string                 `json:"topic"`
}

type RunningWorkflow

type RunningWorkflow struct {
	WorkflowId             string
	RunningWorkflowChannel RunningWorkflowChannel
	Err                    error
	CompletedWorkflow      *model.Workflow
}

func NewRunningWorkflow

func NewRunningWorkflow(workflowId string, runningWorkflowChannel RunningWorkflowChannel, err error) *RunningWorkflow

func (*RunningWorkflow) WaitForCompletionUntilTimeout

func (rw *RunningWorkflow) WaitForCompletionUntilTimeout(timeout time.Duration) (workflow *model.Workflow, err error)

type RunningWorkflowChannel

type RunningWorkflowChannel chan *model.Workflow

type SetVariableTask

type SetVariableTask struct {
	WorkflowTaskBuilder
}

func NewSetVariableTask

func NewSetVariableTask(taskRefName string) *SetVariableTask

func (*SetVariableTask) Description

func (task *SetVariableTask) Description(description string) *SetVariableTask

Description of the task

func (*SetVariableTask) Input

func (task *SetVariableTask) Input(key string, value interface{}) *SetVariableTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SetVariableTask) InputMap

func (task *SetVariableTask) InputMap(inputMap map[string]interface{}) *SetVariableTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SetVariableTask) Optional

func (task *SetVariableTask) Optional(optional bool) *SetVariableTask

Optional if set to true, the task will not fail the workflow if the task fails

type StartWorkflowTask

type StartWorkflowTask struct {
	WorkflowTaskBuilder
}

func NewStartWorkflowTask

func NewStartWorkflowTask(taskRefName string, workflowName string, version *int32, startWorkflowRequest *model.StartWorkflowRequest) *StartWorkflowTask

func (*StartWorkflowTask) Description

func (task *StartWorkflowTask) Description(description string) *StartWorkflowTask

Description of the task

func (*StartWorkflowTask) Input

func (task *StartWorkflowTask) Input(key string, value interface{}) *StartWorkflowTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*StartWorkflowTask) InputMap

func (task *StartWorkflowTask) InputMap(inputMap map[string]interface{}) *StartWorkflowTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*StartWorkflowTask) Optional

func (task *StartWorkflowTask) Optional(optional bool) *StartWorkflowTask

Optional if set to true, the task will not fail the workflow if the task fails

type SubWorkflowTask

type SubWorkflowTask struct {
	WorkflowTaskBuilder
	// contains filtered or unexported fields
}

func NewSubWorkflowInlineTask

func NewSubWorkflowInlineTask(taskRefName string, workflow *WorkflowBuilder) *SubWorkflowTask

func NewSubWorkflowTask

func NewSubWorkflowTask(taskRefName string, workflowName string, version int32) *SubWorkflowTask

func (*SubWorkflowTask) Description

func (task *SubWorkflowTask) Description(description string) *SubWorkflowTask

Description of the task

func (*SubWorkflowTask) Input

func (task *SubWorkflowTask) Input(key string, value interface{}) *SubWorkflowTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SubWorkflowTask) InputMap

func (task *SubWorkflowTask) InputMap(inputMap map[string]interface{}) *SubWorkflowTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SubWorkflowTask) Optional

func (task *SubWorkflowTask) Optional(optional bool) *SubWorkflowTask

Optional if set to true, the task will not fail the workflow if the task fails

func (*SubWorkflowTask) TaskToDomain

func (task *SubWorkflowTask) TaskToDomain(taskToDomainMap map[string]string) *SubWorkflowTask

type SwitchTask

type SwitchTask struct {
	WorkflowTaskBuilder
	DecisionCases map[string][]IWorkflowTask
	// contains filtered or unexported fields
}

func NewSwitchTask

func NewSwitchTask(taskRefName string, caseExpression string) *SwitchTask

func (*SwitchTask) DefaultCase

func (task *SwitchTask) DefaultCase(tasks ...IWorkflowTask) *SwitchTask

func (*SwitchTask) Description

func (task *SwitchTask) Description(description string) *SwitchTask

Description of the task

func (*SwitchTask) Input

func (task *SwitchTask) Input(key string, value interface{}) *SwitchTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SwitchTask) InputMap

func (task *SwitchTask) InputMap(inputMap map[string]interface{}) *SwitchTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*SwitchTask) Optional

func (task *SwitchTask) Optional(optional bool) *SwitchTask

Optional if set to true, the task will not fail the workflow if the task fails

func (*SwitchTask) SwitchCase

func (task *SwitchTask) SwitchCase(caseName string, tasks ...IWorkflowTask) *SwitchTask

func (*SwitchTask) UseJavascript

func (task *SwitchTask) UseJavascript(use bool) *SwitchTask

UseJavascript If set to to true, the caseExpression parameter is treated as a Javascript. If set to false, the caseExpression follows the regular task input mapping format as described in https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html

type TaskType

type TaskType string
const (
	CUSTOM            TaskType = "CUSTOM"
	DYNAMIC           TaskType = "DYNAMIC"
	FORK_JOIN         TaskType = "FORK_JOIN"
	FORK_JOIN_DYNAMIC TaskType = "FORK_JOIN_DYNAMIC"
	SWITCH            TaskType = "SWITCH"
	JOIN              TaskType = "JOIN"
	DO_WHILE          TaskType = "DO_WHILE"
	SUB_WORKFLOW      TaskType = "SUB_WORKFLOW"
	START_WORKFLOW    TaskType = "START_WORKFLOW"
	EVENT             TaskType = "EVENT"
	WAIT              TaskType = "WAIT"
	HUMAN             TaskType = "HUMAN"
	HTTP              TaskType = "HTTP"
	INLINE            TaskType = "INLINE"
	TERMINATE         TaskType = "TERMINATE"
	KAFKA_PUBLISH     TaskType = "KAFKA_PUBLISH"
	JSON_JQ_TRANSFORM TaskType = "JSON_JQ_TRANSFORM"
	SET_VARIABLE      TaskType = "SET_VARIABLE"
)

type TerminateTask

type TerminateTask struct {
	WorkflowTaskBuilder
}

func NewTerminateTask

func NewTerminateTask(taskRefName string, status model.WorkflowStatus, terminationReason string) *TerminateTask

func (*TerminateTask) Description

func (task *TerminateTask) Description(description string) *TerminateTask

Description of the task

func (*TerminateTask) Input

func (task *TerminateTask) Input(key string, value interface{}) *TerminateTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*TerminateTask) InputMap

func (task *TerminateTask) InputMap(inputMap map[string]interface{}) *TerminateTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

type TimeoutPolicy

type TimeoutPolicy string
const (
	TimeOutWorkflow TimeoutPolicy = "TIME_OUT_WF"
	AlertOnly       TimeoutPolicy = "ALERT_ONLY"
)

type WaitTask

type WaitTask struct {
	WorkflowTaskBuilder
}

func NewWaitForDurationTask

func NewWaitForDurationTask(taskRefName string, duration time.Duration) *WaitTask

func NewWaitTask

func NewWaitTask(taskRefName string) *WaitTask

NewWaitTask creates WAIT task used to wait until an external event or a timeout occurs

func NewWaitUntilTask

func NewWaitUntilTask(taskRefName string, dateTime string) *WaitTask

func (*WaitTask) Description

func (task *WaitTask) Description(description string) *WaitTask

Description of the task

func (*WaitTask) Input

func (task *WaitTask) Input(key string, value interface{}) *WaitTask

Input to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*WaitTask) InputMap

func (task *WaitTask) InputMap(inputMap map[string]interface{}) *WaitTask

InputMap to the task. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*WaitTask) Optional

func (task *WaitTask) Optional(optional bool) *WaitTask

Optional if set to true, the task will not fail the workflow if the task fails

type WorkflowBuilder added in v1.5.0

type WorkflowBuilder struct {
	// contains filtered or unexported fields
}

func NewWorkflowBuilder added in v1.5.0

func NewWorkflowBuilder() *WorkflowBuilder

func (*WorkflowBuilder) Add added in v1.5.0

func (workflow *WorkflowBuilder) Add(task IWorkflowTask) *WorkflowBuilder

func (*WorkflowBuilder) Description added in v1.5.0

func (workflow *WorkflowBuilder) Description(description string) *WorkflowBuilder

func (*WorkflowBuilder) FailureWorkflow added in v1.5.0

func (workflow *WorkflowBuilder) FailureWorkflow(failureWorkflow string) *WorkflowBuilder

FailureWorkflow name of the workflow to execute when this workflow fails. Failure workflows can be used for handling compensation logic

func (*WorkflowBuilder) GetName added in v1.5.0

func (workflow *WorkflowBuilder) GetName() (name string)

func (*WorkflowBuilder) GetOutputParameters added in v1.5.0

func (workflow *WorkflowBuilder) GetOutputParameters() (outputParameters map[string]interface{})

func (*WorkflowBuilder) GetVersion added in v1.5.0

func (workflow *WorkflowBuilder) GetVersion() (version int32)

func (*WorkflowBuilder) InputParameters added in v1.5.0

func (workflow *WorkflowBuilder) InputParameters(inputParameters ...string) *WorkflowBuilder

InputParameters List of the input parameters to the workflow. Used ONLY for the documentation purpose.

func (*WorkflowBuilder) InputTemplate added in v1.5.0

func (workflow *WorkflowBuilder) InputTemplate(inputTemplate interface{}) *WorkflowBuilder

InputTemplate template input to the workflow. Can have combination of variables (e.g. ${workflow.input.abc}) and static values

func (*WorkflowBuilder) Name added in v1.5.0

func (workflow *WorkflowBuilder) Name(name string) *WorkflowBuilder

func (*WorkflowBuilder) OutputParameters added in v1.5.0

func (workflow *WorkflowBuilder) OutputParameters(outputParameters interface{}) *WorkflowBuilder

OutputParameters Workflow outputs. Workflow output follows similar structure as task inputs See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for more details

func (*WorkflowBuilder) OwnerEmail added in v1.5.0

func (workflow *WorkflowBuilder) OwnerEmail(ownerEmail string) *WorkflowBuilder

func (*WorkflowBuilder) Restartable added in v1.5.0

func (workflow *WorkflowBuilder) Restartable(restartable bool) *WorkflowBuilder

Restartable if the workflow can be restarted after it has reached terminal state. Set this to false if restarting workflow can have side effects

func (*WorkflowBuilder) TimeoutPolicy added in v1.5.0

func (workflow *WorkflowBuilder) TimeoutPolicy(timeoutPolicy TimeoutPolicy, timeoutSeconds int64) *WorkflowBuilder

func (*WorkflowBuilder) TimeoutSeconds added in v1.5.0

func (workflow *WorkflowBuilder) TimeoutSeconds(timeoutSeconds int64) *WorkflowBuilder

func (*WorkflowBuilder) ToWorkflowDef added in v1.5.0

func (workflow *WorkflowBuilder) ToWorkflowDef() *model.WorkflowDef

ToWorkflowDef converts the workflow to the JSON serializable format

func (*WorkflowBuilder) Variables added in v1.5.0

func (workflow *WorkflowBuilder) Variables(variables interface{}) *WorkflowBuilder

Variables Workflow variables are set using SET_VARIABLE task. Excellent way to maintain business state e.g. Variables can maintain business/user specific states which can be queried and inspected to find out the state of the workflow

func (*WorkflowBuilder) Version added in v1.5.0

func (workflow *WorkflowBuilder) Version(version int32) *WorkflowBuilder

func (*WorkflowBuilder) WorkflowStatusListenerEnabled added in v1.5.0

func (workflow *WorkflowBuilder) WorkflowStatusListenerEnabled(workflowStatusListenerEnabled bool) *WorkflowBuilder

WorkflowStatusListenerEnabled if the workflow status listener need to be enabled.

type WorkflowManager

type WorkflowManager struct {
	// contains filtered or unexported fields
}

func NewWorkflowManager

func NewWorkflowManager(apiClient *client.APIClient) *WorkflowManager

NewWorkflowManager Create a new workflow manager

func (*WorkflowManager) DeleteQueueConfiguration

func (e *WorkflowManager) DeleteQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)

DeleteQueueConfiguration Delete queue configuration permanently from the system Returns nil if no error occurred

func (*WorkflowManager) GetByCorrelationIds

func (e *WorkflowManager) 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 (*WorkflowManager) GetQueueConfiguration

func (e *WorkflowManager) GetQueueConfiguration(queueConfiguration queue.QueueConfiguration) (map[string]interface{}, *http.Response, error)

GetQueueConfiguration Get queue configuration if present Returns queue configuration if present

func (*WorkflowManager) GetTask

func (e *WorkflowManager) GetTask(taskId string) (task *model.WorkerTask, err error)

GetTask by task Id returns nil if no such task is found by the id

func (*WorkflowManager) GetWorkflow

func (e *WorkflowManager) 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 (*WorkflowManager) GetWorkflowStatus

func (e *WorkflowManager) 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 (*WorkflowManager) MonitorExecution

func (e *WorkflowManager) MonitorExecution(workflowId string) (workflowMonitor RunningWorkflowChannel, 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 (*WorkflowManager) Pause

func (e *WorkflowManager) 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 (*WorkflowManager) PutQueueConfiguration

func (e *WorkflowManager) PutQueueConfiguration(queueConfiguration queue.QueueConfiguration) (*http.Response, error)

GetQueueConfiguration Create or update a queue configuration Returns nil if no error occurred

func (*WorkflowManager) ReRun

func (e *WorkflowManager) 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 (*WorkflowManager) RegisterWorkflow

func (e *WorkflowManager) RegisterWorkflow(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 (*WorkflowManager) RemoveWorkflow

func (e *WorkflowManager) RemoveWorkflow(workflowId string) error

RemoveWorkflow Remove workflow execution permanently from the system Returns nil if no workflow is found by the id

func (*WorkflowManager) Restart

func (e *WorkflowManager) 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 (*WorkflowManager) Resume

func (e *WorkflowManager) 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 (*WorkflowManager) Retry

func (e *WorkflowManager) 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 (*WorkflowManager) Search

func (e *WorkflowManager) 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 (*WorkflowManager) SkipTasksFromWorkflow

func (e *WorkflowManager) 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 (*WorkflowManager) StartWorkflow

func (e *WorkflowManager) StartWorkflow(startWorkflowRequest *model.StartWorkflowRequest) (workflowId string, err error)

StartWorkflow Start workflows Returns the id of the newly created workflow

func (*WorkflowManager) StartWorkflowWithInput added in v1.5.0

func (manager *WorkflowManager) StartWorkflowWithInput(workflowDef *model.WorkflowDef, input interface{}) (workflowId string, err error)

StartWorkflowWithInput Execute the workflow with specific input. The input struct MUST be serializable to JSON Returns the workflow Id that can be used to monitor and get the status of the workflow execution

func (*WorkflowManager) StartWorkflows

func (e *WorkflowManager) 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 (*WorkflowManager) Terminate

func (e *WorkflowManager) Terminate(workflowId string, reason string) error

Terminate a running workflow. Reason must be provided that is captured as the termination resaon for the workflow

func (*WorkflowManager) TerminateWithFailure

func (e *WorkflowManager) TerminateWithFailure(workflowId string, reason string, triggerFailureWorkflow bool) error

func (*WorkflowManager) UnRegisterWorkflow

func (e *WorkflowManager) UnRegisterWorkflow(name string, version int32) error

UnRegisterWorkflow Un-registers the workflow on the server.

func (*WorkflowManager) UpdateTask

func (e *WorkflowManager) UpdateTask(taskId string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error

UpdateTask update the task with output and status.

func (*WorkflowManager) WaitForRunningWorkflowsUntilTimeout

func (e *WorkflowManager) WaitForRunningWorkflowsUntilTimeout(timeout time.Duration, runningWorkflows ...*RunningWorkflow)

WaitForRunningWorkflowUntilTimeout 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

type WorkflowTaskBuilder added in v1.5.0

type WorkflowTaskBuilder struct {
	// contains filtered or unexported fields
}

func (*WorkflowTaskBuilder) Description added in v1.5.0

func (builder *WorkflowTaskBuilder) Description(description string) *WorkflowTaskBuilder

Description of the task

func (*WorkflowTaskBuilder) Input added in v1.5.0

func (builder *WorkflowTaskBuilder) Input(key string, value interface{}) *WorkflowTaskBuilder

Input to the builder. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*WorkflowTaskBuilder) InputMap added in v1.5.0

func (builder *WorkflowTaskBuilder) InputMap(inputMap map[string]interface{}) *WorkflowTaskBuilder

InputMap to the builder. See https://swiftconductor.com/devguide/how-tos/Tasks/task-inputs.html for details

func (*WorkflowTaskBuilder) Optional added in v1.5.0

func (builder *WorkflowTaskBuilder) Optional(optional bool) *WorkflowTaskBuilder

Optional if set to true, the task will not fail the workflow if the task fails

func (*WorkflowTaskBuilder) OutputRef added in v1.5.0

func (builder *WorkflowTaskBuilder) OutputRef(path string) string

func (*WorkflowTaskBuilder) ReferenceName added in v1.5.0

func (builder *WorkflowTaskBuilder) ReferenceName() string

func (*WorkflowTaskBuilder) ToTaskDef added in v1.5.0

func (builder *WorkflowTaskBuilder) ToTaskDef() *model.TaskDef

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL