action

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) *baseAction

func NewDelayAction

func NewDelayAction(delaySeconds int, bAction baseAction) *delayAction

func NewJsAction

func NewJsAction(expression string, bAction baseAction) *jsAction

func NewJsonMapAction

func NewJsonMapAction(bAction baseAction) *jsonMapAction

func NewSwitchAction

func NewSwitchAction(expression string, bAction baseAction) *switchAction

func NewWaitAction

func NewWaitAction(eventName string, timeoutSeconds int, 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
	GetParams() 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) GetParams

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

func (*UserAction) GetType

func (ba *UserAction) GetType() ActionType

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