Documentation ¶
Index ¶
- func GetDataResolver() data.Resolver
- func SetLinkExprManagerFactory(factory LinkExprManagerFactory)
- func SetMapperFactory(factory MapperFactory)
- type BasicMapperFactory
- func (mf *BasicMapperFactory) GetDefaultTaskOutputMapper(task *Task) data.Mapper
- func (mf *BasicMapperFactory) NewMapper(mapperDef *MapperDef) data.Mapper
- func (mf *BasicMapperFactory) NewTaskInputMapper(task *Task, mapperDef *MapperDef) data.Mapper
- func (mf *BasicMapperFactory) NewTaskOutputMapper(task *Task, mapperDef *MapperDef) data.Mapper
- type DefaultOutputMapper
- type Definition
- func (pd *Definition) ErrorHandlerTask() *Task
- func (pd *Definition) ExplicitReply() bool
- func (pd *Definition) GetAttr(attrName string) (attr *data.Attribute, exists bool)
- func (pd *Definition) GetLink(linkID int) *Link
- func (pd *Definition) GetLinkExprManager() LinkExprManager
- func (pd *Definition) GetTask(taskID string) *Task
- func (pd *Definition) ModelID() string
- func (pd *Definition) Name() string
- func (pd *Definition) RootTask() *Task
- func (pd *Definition) SetLinkExprManager(mgr LinkExprManager)
- type DefinitionRep
- type FlowResolver
- type Link
- type LinkExprError
- type LinkExprManager
- type LinkExprManagerFactory
- type LinkRep
- type LinkType
- type MapperDef
- type MapperFactory
- type Mappings
- type Task
- func (task *Task) ActivityRef() string
- func (task *Task) ActivityType() string
- func (task *Task) ChildLinks() []*Link
- func (task *Task) ChildTasks() []*Task
- func (task *Task) FromLinks() []*Link
- func (task *Task) GetAttr(attrName string) (attr *data.Attribute, exists bool)
- func (task *Task) GetInputAttr(attrName string) (attr *data.Attribute, exists bool)
- func (task *Task) GetOutputAttr(attrName string) (attr *data.Attribute, exists bool)
- func (task *Task) GetSetting(attrName string) (value interface{}, exists bool)
- func (task *Task) ID() string
- func (task *Task) InputMapper() data.Mapper
- func (task *Task) IsScope() bool
- func (task *Task) Name() string
- func (task *Task) OutputMapper() data.Mapper
- func (task *Task) Parent() *Task
- func (task *Task) String() string
- func (task *Task) ToLinks() []*Link
- func (task *Task) TypeID() int
- type TaskRep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDataResolver ¶
func SetLinkExprManagerFactory ¶
func SetLinkExprManagerFactory(factory LinkExprManagerFactory)
func SetMapperFactory ¶
func SetMapperFactory(factory MapperFactory)
Types ¶
type BasicMapperFactory ¶
type BasicMapperFactory struct {
// contains filtered or unexported fields
}
func (*BasicMapperFactory) GetDefaultTaskOutputMapper ¶
func (mf *BasicMapperFactory) GetDefaultTaskOutputMapper(task *Task) data.Mapper
func (*BasicMapperFactory) NewMapper ¶
func (mf *BasicMapperFactory) NewMapper(mapperDef *MapperDef) data.Mapper
func (*BasicMapperFactory) NewTaskInputMapper ¶
func (mf *BasicMapperFactory) NewTaskInputMapper(task *Task, mapperDef *MapperDef) data.Mapper
func (*BasicMapperFactory) NewTaskOutputMapper ¶
func (mf *BasicMapperFactory) NewTaskOutputMapper(task *Task, mapperDef *MapperDef) data.Mapper
type DefaultOutputMapper ¶
type DefaultOutputMapper struct {
// contains filtered or unexported fields
}
BasicMapper is a simple object holding and executing mappings
type Definition ¶
type Definition struct {
// contains filtered or unexported fields
}
Definition is the object that describes the definition of a flow. It contains its data (attributes) and structure (tasks & links).
func NewDefinition ¶
func NewDefinition(rep *DefinitionRep) (def *Definition, err error)
NewDefinition creates a flow Definition from a serializable definition representation
func (*Definition) ErrorHandlerTask ¶
func (pd *Definition) ErrorHandlerTask() *Task
ErrorHandler returns the error handler task of the definition
func (*Definition) ExplicitReply ¶
func (pd *Definition) ExplicitReply() bool
func (*Definition) GetAttr ¶
func (pd *Definition) GetAttr(attrName string) (attr *data.Attribute, exists bool)
GetAttr gets the specified attribute
func (*Definition) GetLink ¶
func (pd *Definition) GetLink(linkID int) *Link
GetLink returns the link with the specified ID
func (*Definition) GetLinkExprManager ¶
func (pd *Definition) GetLinkExprManager() LinkExprManager
GetLinkExprManager gets the Link Expression Manager for the definition
func (*Definition) GetTask ¶
func (pd *Definition) GetTask(taskID string) *Task
GetTask returns the task with the specified ID
func (*Definition) ModelID ¶
func (pd *Definition) ModelID() string
ModelID returns the ID of the model the definition uses
func (*Definition) Name ¶
func (pd *Definition) Name() string
Name returns the name of the definition
func (*Definition) RootTask ¶
func (pd *Definition) RootTask() *Task
RootTask returns the root task of the definition
func (*Definition) SetLinkExprManager ¶
func (pd *Definition) SetLinkExprManager(mgr LinkExprManager)
SetLinkExprManager sets the Link Expression Manager for the definition
type DefinitionRep ¶
type DefinitionRep struct { ExplicitReply bool `json:"explicitReply"` Name string `json:"name"` ModelID string `json:"model"` Attributes []*data.Attribute `json:"attributes,omitempty"` RootTask *TaskRep `json:"rootTask"` ErrorHandlerTask *TaskRep `json:"errorHandlerTask"` }
DefinitionRep is a serializable representation of a flow Definition
type FlowResolver ¶
type FlowResolver struct { }
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is the object that describes the definition of a link.
func GetExpressionLinks ¶
func GetExpressionLinks(def *Definition) []*Link
GetExpressionLinks gets the links of the definition that are of type LtExpression
type LinkExprError ¶
type LinkExprError struct {
// contains filtered or unexported fields
}
LinkExprError thrown if error is encountered evaluating an link expression
func NewLinkExprError ¶
func NewLinkExprError(msg string) *LinkExprError
func (*LinkExprError) Error ¶
func (e *LinkExprError) Error() string
type LinkExprManager ¶
type LinkExprManager interface { // EvalLinkExpr evaluate the link expression EvalLinkExpr(link *Link, scope data.Scope) (bool, error) }
LinkExprManager interface that defines a Link Expression Manager
type LinkExprManagerFactory ¶
type LinkExprManagerFactory interface {
NewLinkExprManager(def *Definition) LinkExprManager
}
func GetLinkExprManagerFactory ¶
func GetLinkExprManagerFactory() LinkExprManagerFactory
type LinkRep ¶
type LinkRep struct { ID int `json:"id"` Type int `json:"type"` Name string `json:"name"` // Using interface{} type to support backward compatibility changes since Id was // int before, change to string once BC is removed ToID interface{} `json:"to"` // Using interface{} type to support backward compatibility changes since Id was // int before, change to string once BC is removed FromID interface{} `json:"from"` Value string `json:"value"` }
LinkRep is a serializable representation of a flow Link
type LinkType ¶
type LinkType int
LinkType is an enum for possible Link Types
const ( // LtDependency denotes an normal dependency link LtDependency LinkType = 0 // LtExpression denotes a link with an expression LtExpression LinkType = 1 //expr language on the model or def? // LtLabel denotes 'labelled' link LtLabel LinkType = 2 // LtError denotes an error link LtError LinkType = 3 )
type MapperDef ¶
type MapperDef struct {
Mappings []*data.MappingDef
}
MapperDef represents a Mapper, which is a collection of mappings
type MapperFactory ¶
type MapperFactory interface { // NewMapper creates a new Mapper from the specified MapperDef NewMapper(mapperDef *MapperDef) data.Mapper // NewTaskInputMapper creates a new Input Mapper from the specified MapperDef // for the specified Task, method to facilitate pre-compiled mappers NewTaskInputMapper(task *Task, mapperDef *MapperDef) data.Mapper // NewTaskOutputMapper creates a new Output Mapper from the specified MapperDef // for the specified Task, method to facilitate pre-compiled mappers NewTaskOutputMapper(task *Task, mapperDef *MapperDef) data.Mapper // GetDefaultTaskOutputMapper get the default Output Mapper for the // specified Task GetDefaultTaskOutputMapper(task *Task) data.Mapper }
func GetMapperFactory ¶
func GetMapperFactory() MapperFactory
type Mappings ¶
type Mappings struct { Input []*data.MappingDef `json:"input,omitempty"` Output []*data.MappingDef `json:"output,omitempty"` }
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task is the object that describes the definition of a task. It contains its data (attributes) and its nested structure (child tasks & child links).
func (*Task) ActivityType ¶
ActivityType gets the activity type
func (*Task) ChildLinks ¶
ChildLinks gets the child tasks of the task
func (*Task) ChildTasks ¶
ChildTasks gets the child tasks of the task
func (*Task) GetInputAttr ¶
GetAttr gets the specified input attribute
func (*Task) GetOutputAttr ¶
GetOutputAttr gets the specified output attribute
func (*Task) GetSetting ¶
func (*Task) InputMapper ¶
InputMapper returns the InputMapper of the task
func (*Task) IsScope ¶
IsScope returns flag indicating if the Task is a scope task (a container of attributes)
func (*Task) OutputMapper ¶
OutputMapper returns the OutputMapper of the task
type TaskRep ¶
type TaskRep struct { // Using interface{} type to support backward compatibility changes since Id was // int before, change to string once BC is removed ID interface{} `json:"id"` TypeID int `json:"type"` ActivityRef string `json:"activityRef"` Name string `json:"name"` Tasks []*TaskRep `json:"tasks,omitempty"` Links []*LinkRep `json:"links,omitempty"` Mappings *Mappings `json:"mappings,omitempty"` InputAttrs map[string]interface{} `json:"input,omitempty"` OutputAttrs map[string]interface{} `json:"output,omitempty"` Settings map[string]interface{} `json:"settings"` //keep temporarily for backwards compatibility InputAttrsOld map[string]interface{} `json:"inputs,omitempty"` OutputAttrsOld map[string]interface{} `json:"outputs,omitempty"` InputMappings []*data.MappingDef `json:"inputMappings,omitempty"` OutputMappings []*data.MappingDef `json:"outputMappings,omitempty"` Attributes []*data.Attribute `json:"attributes,omitempty"` ActivityType string `json:"activityType"` }
TaskRep is a serializable representation of a flow Task