Documentation ¶
Index ¶
- Constants
- Variables
- func ComponentRbacResource() string
- func ComponentRbacResourceTpl() string
- func DebugStep(log *zap.Logger) *debugStep
- func DelayStep(args ExprSet) *delayStep
- func ErrorHandlerStep(h wfexec.Step, rr *expr.Vars) *errorHandlerStep
- func ExpressionsStep(ee ...*Expr) *expressionsStep
- func FunctionStep(def *Function, arguments, results ExprSet) (*functionStep, error)
- func IsArray(p *Param)
- func IteratorStep(def *Function, arguments, results ExprSet, next, exit wfexec.Step) (*iteratorStep, error)
- func ParseWorkflowVariables(ss []string) (p *expr.Vars, err error)
- func Required(p *Param)
- func Types(tt ...expr.Type) paramOpt
- func WorkflowRbacResource(id uint64) string
- func WorkflowRbacResourceTpl() string
- func WorkflowResourceTranslation(id uint64) string
- func WorkflowResourceTranslationTpl() string
- type Component
- type Expr
- type ExprSet
- type Function
- type FunctionHandler
- type FunctionMeta
- type IteratorHandler
- type LocaleKey
- type Param
- type ParamMeta
- type ParamSet
- type Session
- func (s *Session) AppendRuntimeStacktrace(frame *wfexec.Frame)
- func (s *Session) Apply(ssp SessionStartParams)
- func (s *Session) Cancel()
- func (s *Session) CopyRuntimeStacktrace()
- func (s *Session) DisableStacktrace()
- func (s *Session) Exec(ctx context.Context, step wfexec.Step, input *expr.Vars) error
- func (s *Session) FullStacktrace()
- func (s *Session) GC() bool
- func (r Session) GetID() uint64
- func (r *Session) GetValue(name string, pos uint) (any, error)
- func (s *Session) PendingPrompts(ownerId uint64) []*wfexec.PendingPrompt
- func (s *Session) Resume(ctx context.Context, stateID uint64, input *expr.Vars) (*wfexec.ResumedPrompt, error)
- func (r *Session) SetValue(name string, pos uint, value any) (err error)
- func (s *Session) WaitResults(ctx context.Context) (*expr.Vars, wfexec.SessionStatus, Stacktrace, error)
- type SessionFilter
- type SessionSet
- type SessionStartParams
- type SessionStatus
- type Stacktrace
- type State
- type StateSet
- type Test
- type TestSet
- func (set TestSet) Test(ctx context.Context, scope *expr.Vars) (bool, error)
- func (set TestSet) TestAll(ctx context.Context, scope *expr.Vars) (bool, error)
- func (set TestSet) TestAny(ctx context.Context, scope *expr.Vars) (bool, error)
- func (set TestSet) Validate(ctx context.Context, scope *expr.Vars) (TestSet, error)
- type Trigger
- func (r Trigger) GetID() uint64
- func (m Trigger) GetLabels() map[string]string
- func (r *Trigger) GetValue(name string, pos uint) (any, error)
- func (m Trigger) LabelResourceID() uint64
- func (Trigger) LabelResourceKind() string
- func (m *Trigger) SetLabel(key string, value string)
- func (r *Trigger) SetValue(name string, pos uint, value any) (err error)
- type TriggerConstraint
- type TriggerConstraintSet
- func (set TriggerConstraintSet) Filter(f func(*TriggerConstraint) (bool, error)) (out TriggerConstraintSet, err error)
- func (vv *TriggerConstraintSet) Scan(src any) error
- func (vv TriggerConstraintSet) Value() (driver.Value, error)
- func (set TriggerConstraintSet) Walk(w func(*TriggerConstraint) error) (err error)
- type TriggerFilter
- type TriggerMeta
- type TriggerSet
- func (set TriggerSet) Filter(f func(*Trigger) (bool, error)) (out TriggerSet, err error)
- func (set TriggerSet) FilterByWorkflowID(workflowID uint64) (vv TriggerSet)
- func (set TriggerSet) FindByID(ID uint64) *Trigger
- func (set TriggerSet) IDs() (IDs []uint64)
- func (set TriggerSet) Walk(w func(*Trigger) error) (err error)
- type Workflow
- func (r Workflow) CheckDeferred() bool
- func (r *Workflow) DecodeTranslations(tt locale.ResourceTranslationIndex)
- func (r Workflow) Dict() map[string]interface{}
- func (r *Workflow) EncodeTranslations() (out locale.ResourceTranslationSet)
- func (r Workflow) Executable() bool
- func (r Workflow) GetID() uint64
- func (m Workflow) GetLabels() map[string]string
- func (r *Workflow) GetValue(name string, pos uint) (any, error)
- func (m Workflow) LabelResourceID() uint64
- func (Workflow) LabelResourceKind() string
- func (r Workflow) RbacResource() string
- func (r Workflow) ResourceTranslation() string
- func (m *Workflow) SetLabel(key string, value string)
- func (r *Workflow) SetValue(name string, pos uint, value any) (err error)
- type WorkflowExecParams
- type WorkflowFilter
- type WorkflowIssue
- type WorkflowIssueSet
- func (set WorkflowIssueSet) Append(err error, culprit map[string]int) WorkflowIssueSet
- func (set WorkflowIssueSet) Distinct() (out WorkflowIssueSet)
- func (set WorkflowIssueSet) Error() string
- func (set WorkflowIssueSet) Filter(f func(*WorkflowIssue) (bool, error)) (out WorkflowIssueSet, err error)
- func (set *WorkflowIssueSet) Scan(src any) error
- func (set WorkflowIssueSet) SetCulprit(name string, pos int) WorkflowIssueSet
- func (set WorkflowIssueSet) Value() (driver.Value, error)
- func (set WorkflowIssueSet) Walk(w func(*WorkflowIssue) error) (err error)
- type WorkflowMeta
- type WorkflowPath
- type WorkflowPathMeta
- type WorkflowPathSet
- type WorkflowSet
- type WorkflowStep
- type WorkflowStepKind
- type WorkflowStepMeta
- type WorkflowStepSet
- func (set WorkflowStepSet) Filter(f func(*WorkflowStep) (bool, error)) (out WorkflowStepSet, err error)
- func (set WorkflowStepSet) FindByID(ID uint64) *WorkflowStep
- func (vv WorkflowStepSet) HasDeferred() bool
- func (set WorkflowStepSet) IDs() (IDs []uint64)
- func (vv *WorkflowStepSet) Scan(src any) error
- func (vv WorkflowStepSet) Value() (driver.Value, error)
- func (set WorkflowStepSet) Walk(w func(*WorkflowStep) error) (err error)
Constants ¶
const ( FunctionKindFunction = "function" FunctionKindIterator = "iterator" )
const ( WorkflowResourceType = "corteza::automation:workflow" SessionResourceType = "corteza::automation:session" TriggerResourceType = "corteza::automation:trigger" ComponentResourceType = "corteza::automation" )
const (
WorkflowResourceTranslationType = "automation:workflow"
)
Types and stuff
Variables ¶
var ( LocaleKeyWorkflowName = LocaleKey{ Name: "name", Resource: WorkflowResourceTranslationType, Path: "name", } LocaleKeyWorkflowDescription = LocaleKey{ Name: "description", Resource: WorkflowResourceTranslationType, Path: "description", } )
Functions ¶
func ComponentRbacResource ¶
func ComponentRbacResource() string
ComponentRbacResource returns string representation of RBAC resource for Component
RBAC resource is in the corteza::automation/ format
This function is auto-generated
func ComponentRbacResourceTpl ¶
func ComponentRbacResourceTpl() string
func DelayStep ¶
func DelayStep(args ExprSet) *delayStep
DelayStep creates a step that logs entire contents of the scope
func ExpressionsStep ¶
func ExpressionsStep(ee ...*Expr) *expressionsStep
func FunctionStep ¶
FunctionStep initializes new function step with function definition and configured arguments and results
func IteratorStep ¶
func IteratorStep(def *Function, arguments, results ExprSet, next, exit wfexec.Step) (*iteratorStep, error)
IteratorStep initializes new iterator step with function (iterator) and other parameters
Pointers to next and exit steps are are given and then passed on to the iterator
func WorkflowRbacResource ¶
WorkflowRbacResource returns string representation of RBAC resource for Workflow
RBAC resource is in the corteza::automation:workflow/... format
This function is auto-generated
func WorkflowRbacResourceTpl ¶
func WorkflowRbacResourceTpl() string
func WorkflowResourceTranslation ¶
WorkflowResourceTranslation returns string representation of Locale resource for Workflow
Locale resource is in the automation:workflow/... format
This function is auto-generated
Types ¶
type Component ¶
type Component struct{}
Component struct serves as a virtual resource type for the automation component
This struct is auto-generated
func (Component) RbacResource ¶
RbacResource returns string representation of RBAC resource for Component by calling ComponentRbacResource fn
RBAC resource is in the corteza::automation/... format
This function is auto-generated
type Expr ¶
type Expr struct { // Variable name to set results of the expression to Target string `json:"target"` // Source of the value / name of the variable from scope; if set value is copied target // // Takes precedence to value // Source string `json:"source,omitempty"` // Expression to evaluate over the input variables; results will be set to target // Expr string `json:"expr,omitempty"` // Raw value to be set to target // // If expression is set and fails, evaluation defaults to value and suppresses the error Value interface{} `json:"value,omitempty"` // Expected type of the input value Type string `json:"type,omitempty"` // Set of tests that can be run before input is evaluated and result copied to scope Tests TestSet `json:"tests,omitempty"` // contains filtered or unexported fields }
Used for expression steps, arguments/results mapping and for input validation
type ExprSet ¶
type ExprSet []*Expr
func (ExprSet) Eval ¶
Eval on expression set (ExprSet) evaluates all expressions in the set and returns new scope with all set targets
func (ExprSet) GetByTarget ¶
type Function ¶
type Function struct { Ref string `json:"ref,omitempty"` Kind string `json:"kind,omitempty"` Meta *FunctionMeta `json:"meta,omitempty"` Parameters ParamSet `json:"parameters,omitempty"` Results ParamSet `json:"results,omitempty"` Handler FunctionHandler `json:"-"` Iterator IteratorHandler `json:"-"` Labels map[string]string `json:"labels,omitempty"` Disabled bool `json:"disabled,omitempty"` }
workflow functions are defined in the core code
type FunctionHandler ¶
type FunctionMeta ¶
type IteratorHandler ¶
type Param ¶
type ParamSet ¶
type ParamSet []*Param
func (ParamSet) VerifyArguments ¶
CheckArguments validates (at compile-time) input data (arguments)
func (ParamSet) VerifyResults ¶
CheckArguments validates (at compile-time) input data (arguments)
type Session ¶
type Session struct { ID uint64 `json:"sessionID,string"` WorkflowID uint64 `json:"workflowID,string"` Status SessionStatus `json:"status,string"` EventType string `json:"eventType"` ResourceType string `json:"resourceType"` Input *expr.Vars `json:"input"` Output *expr.Vars `json:"output"` // Stacktrace that gets stored (if/when configured) Stacktrace Stacktrace `json:"stacktrace"` CreatedAt time.Time `json:"createdAt,omitempty"` CreatedBy uint64 `json:"createdBy,string"` PurgeAt *time.Time `json:"purgeAt,omitempty"` // here we join suspended & prompted state; // we treat both states as suspended SuspendedAt *time.Time `json:"suspendedAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` Error string `json:"error,omitempty"` // For keeping runtime stacktrace, // even if we do not want to store it on every update // // This will aid us when session fails and we can access // the whole stacktrace RuntimeStacktrace Stacktrace `json:"-"` // FlushCounter helps us keep track of when we should forcefully flush // the session to the database. // // This is required due to the change in exec stack traces. FlushCounter int `json:"-"` // contains filtered or unexported fields }
Instance of single workflow execution
func NewSession ¶
func (*Session) AppendRuntimeStacktrace ¶
func (*Session) Apply ¶
func (s *Session) Apply(ssp SessionStartParams)
func (*Session) CopyRuntimeStacktrace ¶
func (s *Session) CopyRuntimeStacktrace()
func (*Session) DisableStacktrace ¶
func (s *Session) DisableStacktrace()
func (*Session) FullStacktrace ¶
func (s *Session) FullStacktrace()
func (*Session) PendingPrompts ¶
func (s *Session) PendingPrompts(ownerId uint64) []*wfexec.PendingPrompt
func (*Session) WaitResults ¶
func (s *Session) WaitResults(ctx context.Context) (*expr.Vars, wfexec.SessionStatus, Stacktrace, error)
WaitResults wait blocks until workflow session is completed or fails (or context is canceled) and returns resuts
type SessionFilter ¶
type SessionFilter struct { SessionID []string `json:"sessionID"` WorkflowID []string `json:"workflowID"` CreatedBy []string `json:"createdBy"` EventType string `json:"eventType"` ResourceType string `json:"resourceType"` Completed filter.State `json:"deleted"` Status []uint `json:"status"` // Check fn is called by store backend for each resource found function can // modify the resource and return false if store should not return it // // Store then loads additional resources to satisfy the paging parameters Check func(*Session) (bool, error) `json:"-"` // Standard helpers for paging and sorting filter.Sorting filter.Paging }
type SessionSet ¶
type SessionSet []*Session
SessionSet slice of Session
This type is auto-generated.
func (SessionSet) Filter ¶
func (set SessionSet) Filter(f func(*Session) (bool, error)) (out SessionSet, err error)
Filter iterates through every slice item, calls f(Session) (bool, err) and return filtered slice
This function is auto-generated.
func (SessionSet) FindByID ¶
func (set SessionSet) FindByID(ID uint64) *Session
FindByID finds items from slice by its ID property
This function is auto-generated.
func (SessionSet) IDs ¶
func (set SessionSet) IDs() (IDs []uint64)
IDs returns a slice of uint64s from all items in the set
This function is auto-generated.
type SessionStartParams ¶
type SessionStartParams struct { // Always set, users that invoked/started the workflow session Invoker auth.Identifiable // Optional, (alternative) user that is running the workflow Runner auth.Identifiable WorkflowID uint64 KeepFor int Trace bool Input *expr.Vars StepID uint64 EventType string ResourceType string CallStack []uint64 }
type SessionStatus ¶
type SessionStatus uint
const ( SessionStarted SessionStatus = iota SessionPrompted SessionSuspended SessionFailed SessionCompleted SessionCanceled )
func (SessionStatus) MarshalJSON ¶
func (s SessionStatus) MarshalJSON() ([]byte, error)
func (SessionStatus) String ¶
func (s SessionStatus) String() string
type Stacktrace ¶
func (*Stacktrace) Scan ¶
func (set *Stacktrace) Scan(src any) error
func (Stacktrace) String ¶
func (set Stacktrace) String() (str string)
type State ¶
type State struct { ID uint64 `json:"stateID,string"` SessionID uint64 `json:"sessionID,string"` ResumeAt *time.Time `json:"resumeAt"` WaitingForInput bool `json:"waitingForInput"` CreatedAt time.Time `json:"createdAt,omitempty"` CreatedBy uint64 `json:"createdBy,string"` CallerID uint64 `json:"callerID,string"` StepID uint64 `json:"stepID,string"` Scope *expr.Vars `json:"scope"` }
WorkflowState tracks suspended sessions Session can have more than one state
type StateSet ¶
type StateSet []*State
StateSet slice of State
This type is auto-generated.
func (StateSet) Filter ¶
Filter iterates through every slice item, calls f(State) (bool, err) and return filtered slice
This function is auto-generated.
func (StateSet) FindByID ¶
FindByID finds items from slice by its ID property
This function is auto-generated.
type Test ¶
type Test struct { // Expression to evaluate over the input variables; results will be set to scope under variable Name Expr string `json:"expr,omitempty"` // Error to be if test fails Error string `json:"error"` // contains filtered or unexported fields }
Used for input evaluation
type TestSet ¶
type TestSet []*Test
type Trigger ¶
type Trigger struct { ID uint64 `json:"triggerID,string"` Enabled bool `json:"enabled"` WorkflowID uint64 `json:"workflowID,string"` // Start workflow on this step. If 0, find first (only) orphan StepID uint64 `json:"stepID,string"` // Resource type that can trigger the workflow ResourceType string `json:"resourceType"` // Event type that can trigger the workflow EventType string `json:"eventType"` // Trigger constraints Constraints TriggerConstraintSet `json:"constraints"` // Initial input scope, // will be merged merged with workflow variables Input *expr.Vars `json:"input"` Labels map[string]string `json:"labels,omitempty"` Meta *TriggerMeta `json:"meta,omitempty"` OwnedBy uint64 `json:"ownedBy,string"` CreatedAt time.Time `json:"createdAt,omitempty"` CreatedBy uint64 `json:"createdBy,string" ` UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedBy uint64 `json:"updatedBy,string,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty"` DeletedBy uint64 `json:"deletedBy,string,omitempty"` }
func (Trigger) LabelResourceID ¶
GetLabels adds new label to label map
func (Trigger) LabelResourceKind ¶
GetLabels adds new label to label map
type TriggerConstraint ¶
type TriggerConstraintSet ¶
type TriggerConstraintSet []*TriggerConstraint
TriggerConstraintSet slice of TriggerConstraint
This type is auto-generated.
func ParseTriggerConstraintSet ¶
func ParseTriggerConstraintSet(ss []string) (p TriggerConstraintSet, err error)
func (TriggerConstraintSet) Filter ¶
func (set TriggerConstraintSet) Filter(f func(*TriggerConstraint) (bool, error)) (out TriggerConstraintSet, err error)
Filter iterates through every slice item, calls f(TriggerConstraint) (bool, err) and return filtered slice
This function is auto-generated.
func (*TriggerConstraintSet) Scan ¶
func (vv *TriggerConstraintSet) Scan(src any) error
func (TriggerConstraintSet) Walk ¶
func (set TriggerConstraintSet) Walk(w func(*TriggerConstraint) error) (err error)
Walk iterates through every slice item and calls w(TriggerConstraint) err
This function is auto-generated.
type TriggerFilter ¶
type TriggerFilter struct { TriggerID []string `json:"triggerID"` WorkflowID []string `json:"workflowID"` EventType string `json:"eventType"` ResourceType string `json:"resourceType"` Deleted filter.State `json:"deleted"` Disabled filter.State `json:"disabled"` LabeledIDs []uint64 `json:"-"` Labels map[string]string `json:"labels,omitempty"` // Check fn is called by store backend for each resource found function can // modify the resource and return false if store should not return it // // Store then loads additional resources to satisfy the paging parameters Check func(*Trigger) (bool, error) `json:"-"` // Standard helpers for paging and sorting filter.Sorting filter.Paging }
type TriggerMeta ¶
type TriggerMeta struct { Description string `json:"description"` Visual map[string]interface{} `json:"visual"` }
func ParseTriggerMeta ¶
func ParseTriggerMeta(ss []string) (p *TriggerMeta, err error)
func (*TriggerMeta) Scan ¶
func (vv *TriggerMeta) Scan(src any) error
type TriggerSet ¶
type TriggerSet []*Trigger
TriggerSet slice of Trigger
This type is auto-generated.
func (TriggerSet) Filter ¶
func (set TriggerSet) Filter(f func(*Trigger) (bool, error)) (out TriggerSet, err error)
Filter iterates through every slice item, calls f(Trigger) (bool, err) and return filtered slice
This function is auto-generated.
func (TriggerSet) FilterByWorkflowID ¶
func (set TriggerSet) FilterByWorkflowID(workflowID uint64) (vv TriggerSet)
func (TriggerSet) FindByID ¶
func (set TriggerSet) FindByID(ID uint64) *Trigger
FindByID finds items from slice by its ID property
This function is auto-generated.
func (TriggerSet) IDs ¶
func (set TriggerSet) IDs() (IDs []uint64)
IDs returns a slice of uint64s from all items in the set
This function is auto-generated.
type Workflow ¶
type Workflow struct { ID uint64 `json:"workflowID,string"` Handle string `json:"handle"` Labels map[string]string `json:"labels,omitempty"` Meta *WorkflowMeta `json:"meta,omitempty"` Enabled bool `json:"enabled"` Trace bool `json:"trace"` // how much time do we keep completed sessions (in sec) KeepSessions int `json:"keepSessions"` // Initial input scope Scope *expr.Vars `json:"scope"` Steps WorkflowStepSet `json:"steps"` Paths WorkflowPathSet `json:"paths"` // Collection of issues from the last parse Issues WorkflowIssueSet `json:"issues,omitempty"` RunAs uint64 `json:"runAs,string"` OwnedBy uint64 `json:"ownedBy,string"` CreatedAt time.Time `json:"createdAt,omitempty"` CreatedBy uint64 `json:"createdBy,string" ` UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedBy uint64 `json:"updatedBy,string,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty"` DeletedBy uint64 `json:"deletedBy,string,omitempty"` }
Workflow represents entire workflow definition
func (Workflow) CheckDeferred ¶
CheckDeferred returns true if any of the steps is deferred.
Workflow is considered deferred when delay or prompt step types are used. Deferred workflows cannot short-circuit triggers or prevent creation/update on before triggers
@todo add flag on workflow to explicitly mark workflow as deferred even when there are no delay or prompt steps
func (*Workflow) DecodeTranslations ¶
func (r *Workflow) DecodeTranslations(tt locale.ResourceTranslationIndex)
func (*Workflow) EncodeTranslations ¶
func (r *Workflow) EncodeTranslations() (out locale.ResourceTranslationSet)
func (Workflow) Executable ¶
Executable returns true if workflow is valid and enabled
func (Workflow) LabelResourceID ¶
GetLabels adds new label to label map
func (Workflow) LabelResourceKind ¶
GetLabels adds new label to label map
func (Workflow) RbacResource ¶
RbacResource returns string representation of RBAC resource for Workflow by calling WorkflowRbacResource fn
RBAC resource is in the corteza::automation:workflow/... format
This function is auto-generated
func (Workflow) ResourceTranslation ¶
ResourceTranslation returns string representation of Locale resource for Workflow by calling WorkflowResourceTranslation fn
Locale resource is in the automation:workflow/... format
This function is auto-generated
type WorkflowExecParams ¶
type WorkflowExecParams struct { // When executed as a sub-workflow CallerWorkflowID uint64 // When executed as a sub-workflow CallerSessionID uint64 // When executed as a sub-workflow CallerStepID uint64 // Start with this specific step StepID uint64 EventType string ResourceType string // Enable execution tracing Trace bool // Do not wait for workflow to be finished Async bool // Wait for workflow to be executed even if it's deferred Wait bool Input *expr.Vars }
type WorkflowFilter ¶
type WorkflowFilter struct { WorkflowID []string `json:"workflowID"` Handle string `json:"handle"` Query string `json:"query"` Deleted filter.State `json:"deleted"` Disabled filter.State `json:"disabled"` // include sub-workflows SubWorkflow filter.State `json:"subWorkflow"` LabeledIDs []uint64 `json:"-"` Labels map[string]string `json:"labels,omitempty"` // Check fn is called by store backend for each resource found function can // modify the resource and return false if store should not return it // // Store then loads additional resources to satisfy the paging parameters Check func(*Workflow) (bool, error) `json:"-"` // Standard helpers for paging and sorting filter.Sorting filter.Paging }
type WorkflowIssue ¶
type WorkflowIssue struct { // url encoded location of the error: Culprit map[string]int `json:"culprit"` Description string `json:"description"` }
func (*WorkflowIssue) String ¶
func (issue *WorkflowIssue) String() string
type WorkflowIssueSet ¶
type WorkflowIssueSet []*WorkflowIssue
WorkflowIssueSet slice of WorkflowIssue
This type is auto-generated.
func (WorkflowIssueSet) Append ¶
func (set WorkflowIssueSet) Append(err error, culprit map[string]int) WorkflowIssueSet
func (WorkflowIssueSet) Distinct ¶
func (set WorkflowIssueSet) Distinct() (out WorkflowIssueSet)
Distinct returns set of issues without duplicates
func (WorkflowIssueSet) Error ¶
func (set WorkflowIssueSet) Error() string
func (WorkflowIssueSet) Filter ¶
func (set WorkflowIssueSet) Filter(f func(*WorkflowIssue) (bool, error)) (out WorkflowIssueSet, err error)
Filter iterates through every slice item, calls f(WorkflowIssue) (bool, err) and return filtered slice
This function is auto-generated.
func (*WorkflowIssueSet) Scan ¶
func (set *WorkflowIssueSet) Scan(src any) error
func (WorkflowIssueSet) SetCulprit ¶
func (set WorkflowIssueSet) SetCulprit(name string, pos int) WorkflowIssueSet
func (WorkflowIssueSet) Walk ¶
func (set WorkflowIssueSet) Walk(w func(*WorkflowIssue) error) (err error)
Walk iterates through every slice item and calls w(WorkflowIssue) err
This function is auto-generated.
type WorkflowMeta ¶
type WorkflowMeta struct { Name string `json:"name"` Description string `json:"description"` Visual map[string]interface{} `json:"visual"` // list as one of the sub-workflows, when set to true // there should be no enabled triggers on this workflow SubWorkflow bool `json:"subWorkflow,omitempty"` }
func ParseWorkflowMeta ¶
func ParseWorkflowMeta(ss []string) (p *WorkflowMeta, err error)
func (*WorkflowMeta) Scan ¶
func (vv *WorkflowMeta) Scan(src any) error
type WorkflowPath ¶
type WorkflowPath struct { // Expression to evaluate over the input variables; results will be set to scope under variable Name Expr string `json:"expr,omitempty"` ParentID uint64 `json:"parentID,string"` ChildID uint64 `json:"childID,string"` Meta WorkflowPathMeta `json:"meta,omitempty"` // contains filtered or unexported fields }
WorkflowPath defines connection between two workflow steps
func (WorkflowPath) GetExpr ¶
func (t WorkflowPath) GetExpr() string
func (*WorkflowPath) SetEval ¶
func (t *WorkflowPath) SetEval(eval expr.Evaluable)
type WorkflowPathMeta ¶
type WorkflowPathSet ¶
type WorkflowPathSet []*WorkflowPath
WorkflowPathSet slice of WorkflowPath
This type is auto-generated.
func ParseWorkflowPathSet ¶
func ParseWorkflowPathSet(ss []string) (p WorkflowPathSet, err error)
func (WorkflowPathSet) Filter ¶
func (set WorkflowPathSet) Filter(f func(*WorkflowPath) (bool, error)) (out WorkflowPathSet, err error)
Filter iterates through every slice item, calls f(WorkflowPath) (bool, err) and return filtered slice
This function is auto-generated.
func (*WorkflowPathSet) Scan ¶
func (vv *WorkflowPathSet) Scan(src any) error
func (WorkflowPathSet) Walk ¶
func (set WorkflowPathSet) Walk(w func(*WorkflowPath) error) (err error)
Walk iterates through every slice item and calls w(WorkflowPath) err
This function is auto-generated.
type WorkflowSet ¶
type WorkflowSet []*Workflow
WorkflowSet slice of Workflow
This type is auto-generated.
func (WorkflowSet) Filter ¶
func (set WorkflowSet) Filter(f func(*Workflow) (bool, error)) (out WorkflowSet, err error)
Filter iterates through every slice item, calls f(Workflow) (bool, err) and return filtered slice
This function is auto-generated.
func (WorkflowSet) FindByID ¶
func (set WorkflowSet) FindByID(ID uint64) *Workflow
FindByID finds items from slice by its ID property
This function is auto-generated.
func (WorkflowSet) IDs ¶
func (set WorkflowSet) IDs() (IDs []uint64)
IDs returns a slice of uint64s from all items in the set
This function is auto-generated.
type WorkflowStep ¶
type WorkflowStep struct { ID uint64 `json:"stepID,string"` Kind WorkflowStepKind `json:"kind"` // reference to function or subprocess (workflow) Ref string `json:"ref"` // set of expressions to evaluate, test or pass to function // invalid for for kind=~gateway:* Arguments []*Expr `json:"arguments"` // only valid when kind=function Results []*Expr `json:"results"` Meta WorkflowStepMeta `json:"meta,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
WorkflowStep describes one workflow step
func (WorkflowStep) IsDeferred ¶
func (s WorkflowStep) IsDeferred() (is bool)
IsDeferred fn returns true if type of step is delay or prompt
type WorkflowStepKind ¶
type WorkflowStepKind string
const ( WorkflowStepKindExpressions WorkflowStepKind = "expressions" // no ref WorkflowStepKindGateway WorkflowStepKind = "gateway" // ref = join|fork|excl|incl WorkflowStepKindFunction WorkflowStepKind = "function" // ref = <function ref> WorkflowStepKindIterator WorkflowStepKind = "iterator" // ref = <iterator function ref> WorkflowStepKindError WorkflowStepKind = "error" // no ref WorkflowStepKindTermination WorkflowStepKind = "termination" // no ref WorkflowStepKindPrompt WorkflowStepKind = "prompt" // ref = <client function> WorkflowStepKindDelay WorkflowStepKind = "delay" // no ref WorkflowStepKindErrHandler WorkflowStepKind = "error-handler" // no ref WorkflowStepKindVisual WorkflowStepKind = "visual" // ref = <*> WorkflowStepKindDebug WorkflowStepKind = "debug" // ref = <*> WorkflowStepKindBreak WorkflowStepKind = "break" // ref = <*> WorkflowStepKindContinue WorkflowStepKind = "continue" // ref = <*> WorkflowStepKindExecWorkflow WorkflowStepKind = "exec-workflow" // no ref )
type WorkflowStepMeta ¶
type WorkflowStepSet ¶
type WorkflowStepSet []*WorkflowStep
WorkflowStepSet slice of WorkflowStep
This type is auto-generated.
func ParseWorkflowStepSet ¶
func ParseWorkflowStepSet(ss []string) (p WorkflowStepSet, err error)
func (WorkflowStepSet) Filter ¶
func (set WorkflowStepSet) Filter(f func(*WorkflowStep) (bool, error)) (out WorkflowStepSet, err error)
Filter iterates through every slice item, calls f(WorkflowStep) (bool, err) and return filtered slice
This function is auto-generated.
func (WorkflowStepSet) FindByID ¶
func (set WorkflowStepSet) FindByID(ID uint64) *WorkflowStep
FindByID finds items from slice by its ID property
This function is auto-generated.
func (WorkflowStepSet) HasDeferred ¶
func (vv WorkflowStepSet) HasDeferred() bool
HasDeferred fn returns true if wf-step is delay or prompt
func (WorkflowStepSet) IDs ¶
func (set WorkflowStepSet) IDs() (IDs []uint64)
IDs returns a slice of uint64s from all items in the set
This function is auto-generated.
func (*WorkflowStepSet) Scan ¶
func (vv *WorkflowStepSet) Scan(src any) error
func (WorkflowStepSet) Walk ¶
func (set WorkflowStepSet) Walk(w func(*WorkflowStep) error) (err error)
Walk iterates through every slice item and calls w(WorkflowStep) err
This function is auto-generated.