Documentation ¶
Index ¶
- Constants
- func ApplyExecOptions(instance *IndependentInstance, execOptions *ExecOptions)
- func DefaultConfig() *support.ServiceConfig
- func GetFlowIOMetadata(flowURI string) (*metadata.IOMetadata, error)
- func NewErrorObj(taskId string, msg string) map[string]interface{}
- func StartSubFlow(ctx activity.Context, flowURI string, inputs map[string]interface{}) error
- type ActivityEvalError
- type AttributeChange
- type ChgType
- type ExecOptions
- type IDGenerator
- type IDResponse
- type IndependentInstance
- func (inst *IndependentInstance) ApplyInterceptor(interceptor *flowsupport.Interceptor)
- func (inst *IndependentInstance) ApplyPatch(patch *flowsupport.Patch)
- func (inst *IndependentInstance) DoStep() bool
- func (inst *IndependentInstance) GetChanges() *InstanceChangeTracker
- func (inst *IndependentInstance) HandleGlobalError(containerInst *Instance, err error)
- func (inst *IndependentInstance) MarshalJSON() ([]byte, error)
- func (inst *IndependentInstance) ResetChanges()
- func (inst *IndependentInstance) Restart(id string, manager *flowsupport.FlowManager) error
- func (inst *IndependentInstance) Start(startAttrs map[string]interface{}) bool
- func (inst *IndependentInstance) StepID() int
- func (inst *IndependentInstance) UnmarshalJSON(d []byte) error
- type Instance
- func (inst *Instance) FindOrCreateLinkData(link *definition.Link) (linkInst *LinkInst, created bool)
- func (inst *Instance) FindOrCreateTaskData(task *definition.Task) (taskInst *TaskInst, created bool)
- func (inst *Instance) FlowDefinition() *definition.Definition
- func (inst *Instance) FlowURI() string
- func (inst *Instance) GetError() error
- func (inst *Instance) GetReturnData() (map[string]interface{}, error)
- func (inst *Instance) GetValue(name string) (value interface{}, exists bool)
- func (inst *Instance) ID() string
- func (inst *Instance) IOMetadata() *metadata.IOMetadata
- func (inst *Instance) Logger() log.Logger
- func (inst *Instance) MarshalJSON() ([]byte, error)
- func (inst *Instance) Name() string
- func (inst *Instance) Reply(replyData map[string]interface{}, err error)
- func (inst *Instance) Return(returnData map[string]interface{}, err error)
- func (inst *Instance) Scope() data.Scope
- func (inst *Instance) SetResultHandler(handler action.ResultHandler)
- func (inst *Instance) SetStatus(status model.FlowStatus)
- func (inst *Instance) SetValue(name string, value interface{}) error
- func (inst *Instance) Status() model.FlowStatus
- func (inst *Instance) TaskInstances() []model.TaskInstance
- func (inst *Instance) UnmarshalJSON(d []byte) error
- func (inst *Instance) UpdateAttrs(attrs map[string]interface{})
- type InstanceChange
- type InstanceChangeTracker
- func (ict *InstanceChangeTracker) AttrChange(subFlowId int, chgType ChgType, attribute *data.Attribute)
- func (ict *InstanceChangeTracker) MarshalJSON() ([]byte, error)
- func (ict *InstanceChangeTracker) ResetChanges()
- func (ict *InstanceChangeTracker) SetState(subFlowId int, state int)
- func (ict *InstanceChangeTracker) SetStatus(subFlowId int, status model.FlowStatus)
- func (ict *InstanceChangeTracker) SubFlowChange(parentFlowId int, chgType ChgType, subFlowId int, taskID string)
- type LegacyCtx
- func (l *LegacyCtx) ActivityHost() activity.Host
- func (l *LegacyCtx) GetInput(name string) interface{}
- func (l *LegacyCtx) GetInputObject(input data.StructValue) error
- func (l *LegacyCtx) GetInputSchema(name string) schema.Schema
- func (l *LegacyCtx) GetOutput(name string) interface{}
- func (l *LegacyCtx) GetOutputSchema(name string) schema.Schema
- func (l *LegacyCtx) GetSetting(name string) (interface{}, bool)
- func (l *LegacyCtx) GetSharedTempData() map[string]interface{}
- func (l *LegacyCtx) Logger() log.Logger
- func (l *LegacyCtx) Name() string
- func (l *LegacyCtx) SetOutput(name string, value interface{}) error
- func (l *LegacyCtx) SetOutputObject(output data.StructValue) error
- type LinkInst
- type LinkInstChange
- type RecordSnapshotReq
- type RecordStepReq
- type RemoteStateRecorder
- func (sr *RemoteStateRecorder) Enabled() bool
- func (sr *RemoteStateRecorder) Name() string
- func (sr *RemoteStateRecorder) RecordSnapshot(instance *IndependentInstance)
- func (sr *RemoteStateRecorder) RecordStep(instance *IndependentInstance)
- func (sr *RemoteStateRecorder) Start() error
- func (sr *RemoteStateRecorder) Stop() error
- type RunOptions
- type StateRecorder
- type SubFlowChange
- type TaskInst
- func (ti *TaskInst) ActivityHost() activity.Host
- func (ti *TaskInst) EvalActivity() (done bool, evalErr error)
- func (ti *TaskInst) EvalLink(link *definition.Link) (result bool, err error)
- func (ti *TaskInst) FlowLogger() log.Logger
- func (ti *TaskInst) GetFromLinkInstances() []model.LinkInstance
- func (ti *TaskInst) GetInput(name string) interface{}
- func (ti *TaskInst) GetInputObject(input data.StructValue) error
- func (ti *TaskInst) GetInputSchema(name string) schema.Schema
- func (ti *TaskInst) GetOutputSchema(name string) schema.Schema
- func (ti *TaskInst) GetSetting(name string) (value interface{}, exists bool)
- func (ti *TaskInst) GetSharedTempData() map[string]interface{}
- func (ti *TaskInst) GetToLinkInstances() []model.LinkInstance
- func (ti *TaskInst) GetWorkingData(key string) (interface{}, bool)
- func (ti *TaskInst) HasActivity() bool
- func (ti *TaskInst) Logger() log.Logger
- func (ti *TaskInst) MarshalJSON() ([]byte, error)
- func (ti *TaskInst) Name() string
- func (ti *TaskInst) PostEvalActivity() (done bool, evalErr error)
- func (ti *TaskInst) SetOutput(name string, value interface{}) error
- func (ti *TaskInst) SetOutputObject(output data.StructValue) error
- func (ti *TaskInst) SetStatus(status model.TaskStatus)
- func (ti *TaskInst) SetWorkingData(key string, value interface{})
- func (ti *TaskInst) Status() model.TaskStatus
- func (ti *TaskInst) Task() *definition.Task
- func (ti *TaskInst) UnmarshalJSON(d []byte) error
- type TaskInstChange
- type WorkItem
- type WorkItemQueueChange
- type WorkingDataScope
- func (s *WorkingDataScope) GetValue(name string) (value interface{}, exists bool)
- func (s *WorkingDataScope) GetWorkingValue(name string) (value interface{}, exists bool)
- func (s *WorkingDataScope) SetValue(name string, value interface{}) error
- func (s *WorkingDataScope) SetWorkingValue(name string, value interface{})
Constants ¶
const ( OpStart = iota // 0 OpResume // 1 OpRestart // 2 )
Variables ¶
This section is empty.
Functions ¶
func ApplyExecOptions ¶
func ApplyExecOptions(instance *IndependentInstance, execOptions *ExecOptions)
ApplyExecOptions applies any execution options to the flow instance
func DefaultConfig ¶
func DefaultConfig() *support.ServiceConfig
func GetFlowIOMetadata ¶
func GetFlowIOMetadata(flowURI string) (*metadata.IOMetadata, error)
func NewErrorObj ¶
Types ¶
type ActivityEvalError ¶
type ActivityEvalError struct {
// contains filtered or unexported fields
}
func NewActivityEvalError ¶
func NewActivityEvalError(taskName string, errorType string, errorText string) *ActivityEvalError
func (*ActivityEvalError) Error ¶
func (e *ActivityEvalError) Error() string
func (*ActivityEvalError) TaskName ¶
func (e *ActivityEvalError) TaskName() string
func (*ActivityEvalError) Type ¶
func (e *ActivityEvalError) Type() string
type AttributeChange ¶
AttributeChange represents a change to an Attribute
type ExecOptions ¶
type ExecOptions struct { Patch *support.Patch Interceptor *support.Interceptor }
ExecOptions are optional Patch & Interceptor to be used during instance execution
type IDGenerator ¶
type IDGenerator interface { //NewFlowInstanceID generate a new instance ID NewFlowInstanceID() string }
IDGenerator generates IDs for flow instances
type IDResponse ¶
type IDResponse struct {
ID string `json:"id"`
}
IDResponse is a response object consists of an ID
type IndependentInstance ¶
type IndependentInstance struct { *Instance ChangeTracker *InstanceChangeTracker // contains filtered or unexported fields }
func NewIndependentInstance ¶
func NewIndependentInstance(instanceID string, flowURI string, flow *definition.Definition, logger log.Logger) (*IndependentInstance, error)
New creates a new Flow Instance from the specified Flow
func (*IndependentInstance) ApplyInterceptor ¶
func (inst *IndependentInstance) ApplyInterceptor(interceptor *flowsupport.Interceptor)
func (*IndependentInstance) ApplyPatch ¶
func (inst *IndependentInstance) ApplyPatch(patch *flowsupport.Patch)
func (*IndependentInstance) DoStep ¶
func (inst *IndependentInstance) DoStep() bool
func (*IndependentInstance) GetChanges ¶
func (inst *IndependentInstance) GetChanges() *InstanceChangeTracker
GetChanges returns the Change Tracker object
func (*IndependentInstance) HandleGlobalError ¶
func (inst *IndependentInstance) HandleGlobalError(containerInst *Instance, err error)
HandleGlobalError handles instance errors
func (*IndependentInstance) MarshalJSON ¶
func (inst *IndependentInstance) MarshalJSON() ([]byte, error)
MarshalJSON overrides the default MarshalJSON for FlowInstance
func (*IndependentInstance) ResetChanges ¶
func (inst *IndependentInstance) ResetChanges()
ResetChanges resets an changes that were being tracked
func (*IndependentInstance) Restart ¶
func (inst *IndependentInstance) Restart(id string, manager *flowsupport.FlowManager) error
// Restart indicates that this FlowInstance was restarted
func (*IndependentInstance) Start ¶
func (inst *IndependentInstance) Start(startAttrs map[string]interface{}) bool
func (*IndependentInstance) StepID ¶
func (inst *IndependentInstance) StepID() int
StepID returns the current step ID of the Flow Instance
func (*IndependentInstance) UnmarshalJSON ¶
func (inst *IndependentInstance) UnmarshalJSON(d []byte) error
UnmarshalJSON overrides the default UnmarshalJSON for FlowInstance
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) FindOrCreateLinkData ¶
func (inst *Instance) FindOrCreateLinkData(link *definition.Link) (linkInst *LinkInst, created bool)
FindOrCreateLinkData finds an existing LinkInst or creates ones if not found for the specified link the task environment
func (*Instance) FindOrCreateTaskData ¶
func (inst *Instance) FindOrCreateTaskData(task *definition.Task) (taskInst *TaskInst, created bool)
FindOrCreateTaskData finds an existing TaskInst or creates ones if not found for the specified task the task environment
func (*Instance) FlowDefinition ¶
func (inst *Instance) FlowDefinition() *definition.Definition
FlowDefinition returns the Flow definition associated with this context
func (*Instance) GetReturnData ¶
func (*Instance) IOMetadata ¶
func (inst *Instance) IOMetadata() *metadata.IOMetadata
IOMetadata get the input/output metadata of the activity host
func (*Instance) MarshalJSON ¶
MarshalJSON overrides the default MarshalJSON for FlowInstance
func (*Instance) SetResultHandler ¶
func (inst *Instance) SetResultHandler(handler action.ResultHandler)
InitActionContext initialize the action context, should be initialized before execution
func (*Instance) SetStatus ¶
func (inst *Instance) SetStatus(status model.FlowStatus)
func (*Instance) Status ¶
func (inst *Instance) Status() model.FlowStatus
Status returns the current status of the Flow Instance
func (*Instance) TaskInstances ¶
func (inst *Instance) TaskInstances() []model.TaskInstance
TaskInstances get the task instances
func (*Instance) UnmarshalJSON ¶
UnmarshalJSON overrides the default UnmarshalJSON for FlowInstance
func (*Instance) UpdateAttrs ¶
UpdateAttrs updates the attributes of the Flow Instance
type InstanceChange ¶
type InstanceChange struct { SubFlowID int Status model.FlowStatus AttrChanges []*AttributeChange SubFlowChg *SubFlowChange State int // contains filtered or unexported fields }
InstanceChange represents a change to the instance
func (*InstanceChange) MarshalJSON ¶
func (ic *InstanceChange) MarshalJSON() ([]byte, error)
MarshalJSON overrides the default MarshalJSON for InstanceChangeTracker
type InstanceChangeTracker ¶
type InstanceChangeTracker struct {
// contains filtered or unexported fields
}
InstanceChangeTracker is used to track all changes to an instance
func NewInstanceChangeTracker ¶
func NewInstanceChangeTracker() *InstanceChangeTracker
NewInstanceChangeTracker creates an InstanceChangeTracker
func (*InstanceChangeTracker) AttrChange ¶
func (ict *InstanceChangeTracker) AttrChange(subFlowId int, chgType ChgType, attribute *data.Attribute)
AttrChange is called to track a status change of an Attribute
func (*InstanceChangeTracker) MarshalJSON ¶
func (ict *InstanceChangeTracker) MarshalJSON() ([]byte, error)
MarshalJSON overrides the default MarshalJSON for InstanceChangeTracker
func (*InstanceChangeTracker) ResetChanges ¶
func (ict *InstanceChangeTracker) ResetChanges()
ResetChanges is used to reset any tracking data stored on instance objects
func (*InstanceChangeTracker) SetState ¶
func (ict *InstanceChangeTracker) SetState(subFlowId int, state int)
SetStatus is called to track a state change on an instance
func (*InstanceChangeTracker) SetStatus ¶
func (ict *InstanceChangeTracker) SetStatus(subFlowId int, status model.FlowStatus)
SetStatus is called to track a status change on an instance
func (*InstanceChangeTracker) SubFlowChange ¶
func (ict *InstanceChangeTracker) SubFlowChange(parentFlowId int, chgType ChgType, subFlowId int, taskID string)
AttrChange is called to track a status change of an Attribute
type LegacyCtx ¶
type LegacyCtx struct {
// contains filtered or unexported fields
}
DEPRECATED
func (*LegacyCtx) ActivityHost ¶
func (*LegacyCtx) GetInputObject ¶
func (l *LegacyCtx) GetInputObject(input data.StructValue) error
func (*LegacyCtx) GetSetting ¶
func (*LegacyCtx) GetSharedTempData ¶
func (*LegacyCtx) SetOutputObject ¶
func (l *LegacyCtx) SetOutputObject(output data.StructValue) error
type LinkInst ¶
type LinkInst struct {
// contains filtered or unexported fields
}
LinkInst represents data associated with an instance of a Link
func NewLinkInst ¶
func NewLinkInst(inst *Instance, link *definition.Link) *LinkInst
NewLinkInst creates a LinkInst for the specified link in the specified task environment
func (*LinkInst) Link ¶
func (ld *LinkInst) Link() *definition.Link
Link returns the Link associated with ld context
func (*LinkInst) MarshalJSON ¶
MarshalJSON overrides the default MarshalJSON for LinkInst
func (*LinkInst) SetStatus ¶
func (ld *LinkInst) SetStatus(status model.LinkStatus)
SetStatus sets the current state indicator for the LinkInst
func (*LinkInst) Status ¶
func (ld *LinkInst) Status() model.LinkStatus
Status returns the current state indicator for the LinkInst
func (*LinkInst) UnmarshalJSON ¶
UnmarshalJSON overrides the default UnmarshalJSON for LinkInst
type LinkInstChange ¶
LinkInstChange represents a change to a LinkInst
func (*LinkInstChange) MarshalJSON ¶
func (li *LinkInstChange) MarshalJSON() ([]byte, error)
MarshalJSON overrides the default MarshalJSON for TaskInst
type RecordSnapshotReq ¶
type RecordSnapshotReq struct { ID int `json:"id"` FlowID string `json:"flowID"` State int `json:"state"` Status int `json:"status"` SnapshotData *IndependentInstance `json:"snapshotData"` }
RecordSnapshotReq serializable representation of the RecordSnapshot request
type RecordStepReq ¶
type RecordStepReq struct { ID int `json:"id"` FlowID string `json:"flowID"` //todo should move to the "stepData" State int `json:"state"` Status int `json:"status"` //todo we should have initial "init" to associate flowURI with flowID, instead of at every step FlowURI string `json:"flowURI"` StepData *InstanceChangeTracker `json:"stepData"` }
RecordStepReq serializable representation of the RecordStep request
type RemoteStateRecorder ¶
type RemoteStateRecorder struct {
// contains filtered or unexported fields
}
RemoteStateRecorder is an implementation of StateRecorder service that can access flows via URI
func NewRemoteStateRecorder ¶
func NewRemoteStateRecorder(config *support.ServiceConfig) *RemoteStateRecorder
NewRemoteStateRecorder creates a new RemoteStateRecorder
func (*RemoteStateRecorder) Enabled ¶
func (sr *RemoteStateRecorder) Enabled() bool
func (*RemoteStateRecorder) Name ¶
func (sr *RemoteStateRecorder) Name() string
func (*RemoteStateRecorder) RecordSnapshot ¶
func (sr *RemoteStateRecorder) RecordSnapshot(instance *IndependentInstance)
RecordSnapshot implements instance.StateRecorder.RecordSnapshot
func (*RemoteStateRecorder) RecordStep ¶
func (sr *RemoteStateRecorder) RecordStep(instance *IndependentInstance)
RecordStep implements instance.StateRecorder.RecordStep
func (*RemoteStateRecorder) Start ¶
func (sr *RemoteStateRecorder) Start() error
Start implements util.Managed.Start()
func (*RemoteStateRecorder) Stop ¶
func (sr *RemoteStateRecorder) Stop() error
Stop implements util.Managed.Stop()
type RunOptions ¶
type RunOptions struct { Op int ReturnID bool FlowURI string InitialState *IndependentInstance ExecOptions *ExecOptions }
RunOptions the options when running a FlowAction
type StateRecorder ¶
type StateRecorder interface { // RecordSnapshot records a Snapshot of the FlowInstance RecordSnapshot(instance *IndependentInstance) // RecordStep records the changes for the current Step of the Flow Instance RecordStep(instance *IndependentInstance) }
StateRecorder is the interface that describes a service that can record snapshots and steps of a Flow Instance
type SubFlowChange ¶
InstanceChange represents a change to the instance
type TaskInst ¶
type TaskInst struct {
// contains filtered or unexported fields
}
func NewTaskInst ¶
func NewTaskInst(inst *Instance, task *definition.Task) *TaskInst
func (*TaskInst) ActivityHost ¶
func (*TaskInst) EvalActivity ¶
EvalActivity implements activity.ActivityContext.EvalActivity method
func (*TaskInst) EvalLink ¶
func (ti *TaskInst) EvalLink(link *definition.Link) (result bool, err error)
EvalLink implements activity.ActivityContext.EvalLink method
func (*TaskInst) FlowLogger ¶
func (*TaskInst) GetFromLinkInstances ¶
func (ti *TaskInst) GetFromLinkInstances() []model.LinkInstance
GetFromLinkInstances implements model.TaskContext.GetFromLinkInstances
func (*TaskInst) GetInputObject ¶
func (ti *TaskInst) GetInputObject(input data.StructValue) error
GetInputObject implements activity.Context.GetInputObject
func (*TaskInst) GetSetting ¶
func (*TaskInst) GetSharedTempData ¶
func (*TaskInst) GetToLinkInstances ¶
func (ti *TaskInst) GetToLinkInstances() []model.LinkInstance
GetToLinkInstances implements model.TaskContext.GetToLinkInstances,
func (*TaskInst) GetWorkingData ¶
func (*TaskInst) HasActivity ¶
HasActivity implements activity.ActivityContext.HasActivity method
func (*TaskInst) MarshalJSON ¶
MarshalJSON overrides the default MarshalJSON for TaskInst
func (*TaskInst) PostEvalActivity ¶
EvalActivity implements activity.ActivityContext.EvalActivity method
func (*TaskInst) SetOutputObject ¶
func (ti *TaskInst) SetOutputObject(output data.StructValue) error
SetOutputObject implements activity.Context.SetOutputObject
func (*TaskInst) SetStatus ¶
func (ti *TaskInst) SetStatus(status model.TaskStatus)
SetStatus implements flow.TaskContext.SetStatus
func (*TaskInst) SetWorkingData ¶
func (*TaskInst) Status ¶
func (ti *TaskInst) Status() model.TaskStatus
Status implements flow.TaskContext.GetState
func (*TaskInst) Task ¶
func (ti *TaskInst) Task() *definition.Task
Task implements model.TaskContext.Task, by returning the Task associated with this TaskInst object
func (*TaskInst) UnmarshalJSON ¶
UnmarshalJSON overrides the default UnmarshalJSON for TaskInst
type TaskInstChange ¶
TaskInstChange represents a change to a TaskInst
func (*TaskInstChange) MarshalJSON ¶
func (ti *TaskInstChange) MarshalJSON() ([]byte, error)
MarshalJSON overrides the default MarshalJSON for TaskInst
type WorkItem ¶
type WorkItem struct { ID int `json:"id"` TaskID string `json:"taskID"` SubFlowID int `json:"subFlowId"` // contains filtered or unexported fields }
WorkItem describes an item of work (event for a Task) that should be executed on Step
func NewWorkItem ¶
NewWorkItem constructs a new WorkItem for the specified TaskInst
type WorkItemQueueChange ¶
WorkItemQueueChange represents a change in the WorkItem Queue
type WorkingDataScope ¶
type WorkingDataScope struct {
// contains filtered or unexported fields
}
func NewWorkingDataScope ¶
func NewWorkingDataScope(parentScope data.Scope) *WorkingDataScope
NewWorkingDataScope
func (*WorkingDataScope) GetValue ¶
func (s *WorkingDataScope) GetValue(name string) (value interface{}, exists bool)
func (*WorkingDataScope) GetWorkingValue ¶
func (s *WorkingDataScope) GetWorkingValue(name string) (value interface{}, exists bool)
func (*WorkingDataScope) SetValue ¶
func (s *WorkingDataScope) SetValue(name string, value interface{}) error
func (*WorkingDataScope) SetWorkingValue ¶
func (s *WorkingDataScope) SetWorkingValue(name string, value interface{})