action

package
v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VALID_SYSTEM_ACTIONS = []string{"switch", "delay"}

Functions

func NewBaseAction

func NewBaseAction(id int, Type ActionType, name string, inputParams map[string]any, nextMap map[string]int, container *container.DIContiner) *baseAction

func NewDelayAction

func NewDelayAction(delaySeconds int, bAction baseAction) *delayAction

func NewJsAction

func NewJsAction(expression string, bAction baseAction) *jsAction

func NewSwitchAction

func NewSwitchAction(expression string, bAction baseAction) *switchAction

func NewWaitAction

func NewWaitAction(eventName string, bAction baseAction) *waitAction

func ValidateActionType

func ValidateActionType(at string) error

Types

type Action

type Action interface {
	GetId() int
	GetName() string
	GetType() ActionType
	GetInputParams() map[string]any
	GetNext() map[string]int
	Validate() error
	Execute(wfName string, flowContext *model.FlowContext, retryCount int) (string, map[string]any, error)
}

type ActionType

type ActionType string
const ACTION_TYPE_SYSTEM ActionType = "SYSTEM"
const ACTION_TYPE_USER ActionType = "USER"

func ToActionType

func ToActionType(at string) ActionType

type UserAction

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

func NewUserAction

func NewUserAction(bAction baseAction) *UserAction

func (*UserAction) Execute

func (ua *UserAction) Execute(wfName string, flowContext *model.FlowContext, retryCount int) (string, map[string]any, error)

func (*UserAction) GetId

func (ba *UserAction) GetId() int

func (*UserAction) GetInputParams

func (ba *UserAction) GetInputParams() map[string]any

func (*UserAction) GetName

func (ba *UserAction) GetName() string

func (*UserAction) GetNext

func (ua *UserAction) GetNext() map[string]int

func (*UserAction) GetType

func (ba *UserAction) GetType() ActionType

func (*UserAction) ResolveInputParams

func (ba *UserAction) ResolveInputParams(flowContext *model.FlowContext) map[string]any

func (*UserAction) Validate

func (ua *UserAction) Validate() error

Jump to

Keyboard shortcuts

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