builder

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInitExecutionOperations

func BuildInitExecutionOperations(ctx context.Context, deploymentID, taskID, workflowName string, registerWorkflow bool) (api.KVTxnOps, error)

BuildInitExecutionOperations returns Consul transactional KV operations for initiating workflow execution

func BuildWorkFlow

func BuildWorkFlow(ctx context.Context, deploymentID, wfName string) (map[string]*Step, error)

BuildWorkFlow creates a workflow tree from values for a specified workflow name and deploymentID

Types

type Activity

type Activity interface {
	// Type returns the ActivityType if this activity
	Type() ActivityType

	// Value returns the actual value of this activity
	//
	// For delegate activities it's the delegate operation name.
	// For set-state activities it's the state value.
	// For call-operation activities it's the operation name.
	// For inline activities it's the inlined workflow name.
	Value() string

	// Inputs returns the inputs parameters defined in the activity
	// It is not relevant for set-state activities
	Inputs() map[string]tosca.ParameterDefinition
}

An Activity is the representation of a workflow activity

type ActivityType

type ActivityType int

ActivityType is an enumerated type for step activities

ENUM( delegate set-state call-operation inline )

const (
	// ActivityTypeDelegate is a ActivityType of type Delegate
	ActivityTypeDelegate ActivityType = iota
	// ActivityTypeSetState is a ActivityType of type Set-State
	ActivityTypeSetState
	// ActivityTypeCallOperation is a ActivityType of type Call-Operation
	ActivityTypeCallOperation
	// ActivityTypeInline is a ActivityType of type Inline
	ActivityTypeInline
)

func ParseActivityType

func ParseActivityType(name string) (ActivityType, error)

ParseActivityType attempts to convert a string to a ActivityType

func (ActivityType) String

func (x ActivityType) String() string

String implements the Stringer interface.

type Step

type Step struct {
	Name               string
	Target             string
	TargetRelationship string
	OperationHost      string
	Activities         []Activity
	Next               []*Step
	OnFailure          []*Step
	OnCancel           []*Step
	Previous           []*Step
	WorkflowName       string
	Async              bool
	IsOnFailurePath    bool
	IsOnCancelPath     bool
}

Step represents the workflow step

func (*Step) IsInitial

func (s *Step) IsInitial() bool

IsInitial returns true is the workflow step has no previous step

func (*Step) IsTerminal

func (s *Step) IsTerminal() bool

IsTerminal returns true is the workflow step has no next step

Jump to

Keyboard shortcuts

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