taskengine

package
v5.8.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

------------------------------------------------------------------------------ NB: the code here has been initialized by using the VSCode snippet "New Entity BI"; we leave all the commented code here to show all the methods that can be overridden ------------------------------------------------------------------------------

Index

Constants

View Source
const (
	FieldTaskFlowConfigREFERENCE   g.EntityPropertyID = "taskflowconfig$Reference"
	FieldTaskFlowConfigNAME        g.EntityPropertyID = "taskflowconfig$Name"
	LinkTaskFlowConfigTASKS        g.EntityPropertyID = "taskflowconfig$Tasks"
	LinkTaskFlowConfigGROUPS       g.EntityPropertyID = "taskflowconfig$Groups"
	LinkTaskFlowConfigRUNNINGFLOWS g.EntityPropertyID = "taskflowconfig$RunningFlows"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	LoadingTASKFLOWCONFIGFULL g.LoadingID = "full_flow_config"
	LoadingTASKFLOWCONFIG4WEB g.LoadingID = "flow_config_4_web"
)

Loading IDs

View Source
const (
	FieldTaskGroupConfigGLOBALREFERENCE g.EntityPropertyID = "taskgroupconfig$GlobalReference"
	FieldTaskGroupConfigNAME            g.EntityPropertyID = "taskgroupconfig$Name"
	LinkTaskGroupConfigFLOW             g.EntityPropertyID = "taskgroupconfig$Flow"
	LinkTaskGroupConfigTASKS            g.EntityPropertyID = "taskgroupconfig$Tasks"
	LinkTaskGroupConfigRUNNINGGROUPS    g.EntityPropertyID = "taskgroupconfig$RunningGroups"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	FieldTaskConfigGLOBALREFERENCE g.EntityPropertyID = "taskconfig$GlobalReference"
	FieldTaskConfigNAME            g.EntityPropertyID = "taskconfig$Name"
	LinkTaskConfigFLOW             g.EntityPropertyID = "taskconfig$Flow"
	LinkTaskConfigGROUP            g.EntityPropertyID = "taskconfig$Group"
	LinkTaskConfigDEPENDSON        g.EntityPropertyID = "taskconfig$DependsOn"
	LinkTaskConfigNEXTTASKS        g.EntityPropertyID = "taskconfig$NextTasks"
	LinkTaskConfigPARAMS           g.EntityPropertyID = "taskconfig$Params"
	LinkTaskConfigRUNNINGTASKS     g.EntityPropertyID = "taskconfig$RunningTasks"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	LoadingTASKCONF4WEB   g.LoadingID = "task_4_web"
	LoadingTASKCONFPARAMS g.LoadingID = "just_params"
)

Loading IDs

View Source
const (
	FieldTaskParameterGLOBALREFERENCE g.EntityPropertyID = "taskparameter$GlobalReference"
	FieldTaskParameterPARAMID         g.EntityPropertyID = "taskparameter$ParamID"
	FieldTaskParameterVALUE           g.EntityPropertyID = "taskparameter$Value"
	LinkTaskParameterTASK             g.EntityPropertyID = "taskparameter$Task"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	// TaskActionDISPLAY : displaying a task flow config, or a task flow
	TaskActionDISPLAY = TaskActionType(geen.ActionLAST + iota)

	// TaskActionRUN : running the flow
	TaskActionRUN
)
View Source
const (
	FieldTaskFlowREFERENCE g.EntityPropertyID = "taskflow$Reference"
	LinkTaskFlowCONFIG     g.EntityPropertyID = "taskflow$FlowConfig"
	LinkTaskFlowGROUPS     g.EntityPropertyID = "taskflow$Groups"
	LinkTaskFlowTASKS      g.EntityPropertyID = "taskflow$Tasks"
	LinkTaskFlowLOGS       g.EntityPropertyID = "taskflow$Logs"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	LoadingTASKFLOWTASKS g.LoadingID = "tasks_only"
	LoadingTASKFLOW4WEB  g.LoadingID = "flow_4_web"
)

Loading IDs

View Source
const (
	// FieldTaskGroupACTION g.EntityPropertyID = "taskgroup$Action"
	LinkTaskGroupGROUPCONFIG g.EntityPropertyID = "taskgroup$GroupConfig"
	LinkTaskGroupFLOW        g.EntityPropertyID = "taskgroup$Flow"
	LinkTaskGroupTASKS       g.EntityPropertyID = "taskgroup$Tasks"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	// FieldTaskACTION g.EntityPropertyID = "task$Action"
	LinkTaskTASKCONFIG   g.EntityPropertyID = "task$TaskConfig"
	LinkTaskFLOW         g.EntityPropertyID = "task$Flow"
	LinkTaskGROUP        g.EntityPropertyID = "task$Group"
	LinkTaskDEPENDSON    g.EntityPropertyID = "task$DependsOn"
	LinkTaskNEXTTASKS    g.EntityPropertyID = "task$NextTasks"
	LinkTaskLOGS         g.EntityPropertyID = "task$Logs"
	LinkTaskALLDEPENDSON g.EntityPropertyID = "task$AllDependsOn"
	LinkTaskALLNEXTTASKS g.EntityPropertyID = "task$AllNextTasks"
	LinkTaskHEAD         g.EntityPropertyID = "task$Head"
	LinkTaskHEADTASKS    g.EntityPropertyID = "task$HeadTasks"
	LinkTaskTAIL         g.EntityPropertyID = "task$Tail"
	LinkTaskTAILTASKS    g.EntityPropertyID = "task$TailTasks"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	LoadingTASK4WEB            g.LoadingID = "task_4_web"
	LoadingTASKWITHFLOW        g.LoadingID = "task_with_flow"
	LoadingTASK_WITH_INTERVALS g.LoadingID = "task_with_intervals"
)

Loading IDs

View Source
const (
	// FieldTaskLogACTION g.EntityPropertyID = "tasklog$Action"
	LinkTaskLogTASK g.EntityPropertyID = "tasklog$Task"
	LinkTaskLogFLOW g.EntityPropertyID = "tasklog$Flow"
)

Entity property IDs, allowing referencing properties of a given entity type from another entity type

View Source
const (
	LoadingGROUPCONF4WEB g.LoadingID = "group_4_web"
)

Loading IDs

Variables

View Source
var KindTASK = g.RegisterKind(&Task{}, "")

KindTASK stores the entity kind associated with 'Task' entities

View Source
var KindTASKCONFIG = g.RegisterKind(&TaskConfig{}, "")

KindTASKCONFIG stores the entity kind associated with 'TaskConfig' entities

View Source
var KindTASKFLOW = g.RegisterKind(&TaskFlow{}, "")

KindTASKFLOW stores the entity kind associated with 'TaskFlow' entities

View Source
var KindTASKFLOWCONFIG = g.RegisterKind(&TaskFlowConfig{}, "")

KindTASKFLOWCONFIG stores the entity kind associated with 'TaskFlowConfig' entities

View Source
var KindTASKGROUP = g.RegisterKind(&TaskGroup{}, "")

KindTASKGROUP stores the entity kind associated with 'TaskGroup' entities

View Source
var KindTASKGROUPCONFIG = g.RegisterKind(&TaskGroupConfig{}, "")

KindTASKGROUPCONFIG stores the entity kind associated with 'EntityTypeMin' entities

View Source
var KindTASKLOG = g.RegisterKind(&TaskLog{}, "")

KindTASKLOG stores the entity kind associated with 'TaskLog' entities

View Source
var KindTASKPARAMETER = g.RegisterKind(&TaskParameter{}, "")

KindTASKPARAMETER stores the entity kind associated with 'TaskParameter' entities

Functions

func RegisterTaskFunction

func RegisterTaskFunction(functionName TaskFunctionName, function taskFunction)

RegisterTaskFunction : registring a task function

Types

type FlowStatus

type FlowStatus int

FlowStatus is used to define the different statuses a flow can have

const (
	// FlowStatusERROR    FlowStatus = -2 // the flow cannot go on because of an error somewhere
	FlowStatusCANCELED FlowStatus = -1 // the flow has been canceled by a user
	FlowStatusCREATED  FlowStatus = 0  // the flow has been created, but never started thus far
	FlowStatusWAITING  FlowStatus = 3  // the flow waits for manual actions
	FlowStatusONGOING  FlowStatus = 5  // the flow is currently running
	FlowStatusPAUSED   FlowStatus = 7  // the flow has been deliberately paused by the user
	FlowStatusFINISHED FlowStatus = 9  // the flow has all its tasks finished
)

The flow statuses

func (FlowStatus) String

func (thisFlowStatus FlowStatus) String() string

func (FlowStatus) Val

func (thisFlowStatus FlowStatus) Val() int

Val helps implement the IEnum interface

func (FlowStatus) Values

func (thisFlowStatus FlowStatus) Values() map[int]string

Values helps implement the IEnum interface

type Task

type Task struct {
	g.Entity                             // is a particular kind of geen entity
	TaskConfig          *TaskConfig      `db:"taskConfig_id"       json:"taskConfig"          i*:"the configuration for this task"`
	Flow                *TaskFlow        `db:"flow_id"             json:"flow"                i*:"the flow this task belongs to"`
	FlowRef             string           `db:"flowRef,43"          json:"flowRef"             i*:"the flow's reference"`
	Group               *TaskGroup       `db:"group_id"            json:"group"               i*:"the group this task belongs to"`
	Num                 int              `db:"num"                 json:"num"                 o*:"an arbitrary number for this task within the flow"`
	Reference           string           `db:"reference,30"        json:"reference"           o*:"the task reference, coming from the task config"`
	GlobalReference     string           `` /* 136-byte string literal not displayed */
	Name                string           `db:"name,128"            json:"name"                i*:"the task name, coming from the task config"`
	FunctionName        TaskFunctionName `` /* 135-byte string literal not displayed */
	Manual              bool             `` /* 137-byte string literal not displayed */
	DependsOn           []*Task          `` /* 142-byte string literal not displayed */
	NextTasks           []*Task          `` /* 130-byte string literal not displayed */
	IntervalMin         float64          `db:"intervalMin,8.4"     json:"intervalMin"         o*:"the lower border of the interval this tasks is supposed to deal with"`
	IntervalMax         float64          `db:"intervalMax,8.4"     json:"intervalMax"         o*:"the upper border of the interval this tasks is supposed to deal with"`
	NbParallelIntervals int              `` /* 157-byte string literal not displayed */
	CompactView         bool             `` /* 172-byte string literal not displayed */
	Status              TaskStatus       `db:"status,2"            json:"status"              o*:"the task's status"`
	StatusString        string           `db:"-"                   json:"statusString"        o*:"the task's status as a string"`
	Started             *time.Time       `db:"started,6"           json:"started"             o*:"the starting time of the task"`
	Updated             *time.Time       `db:"updated,6"           json:"updated"             o*:"the time of the last update for this task"`
	Finished            *time.Time       `db:"finished,6"          json:"finished"            o*:"the starting time of the task"`
	CurrentProgress     int              `db:"currentProgress"     json:"currentProgress"     o*:"the last progress we know about"`
	LastComment         string           `db:"lastComment,255"     json:"lastComment"         o*:"the last comment we know about"`
	Logs                []*TaskLog       `db:"-"                   json:"logs"                o*:"the logs created during the running of this task"`
	ETA                 time.Duration    `db:"eta"                 json:"eta"                 o*:"the estimated time for completion"`
	ETAString           string           `db:"etaString,16"        json:"etaString"           o*:"the estimated time for completion (string version)"`
	TotalElapsed        string           `db:"-"                   json:"totalElapsed"        o*:"the total time spent from start to finish"`
	AllDependsOn        []*Task          `db:"-"                   json:"allDependsOn"        in:"all the dependencies, whatever their nature"`
	AllNextTasks        []*Task          `db:"-"                   json:"allNextTasks"        in:"all the next tasks, whatever their nature"`
	Head                *Task            `db:"head_id"             json:"-"                   i*:"this task's head, when this is an interval task"`
	HeadTasks           []*Task          `db:"-"                   json:"-"                   o*:"all the tasks that have this task as their head"`
	Tail                *Task            `db:"tail_id"             json:"-"                   o*:"this task's tail, when this is an interval task"`
	TailTasks           []*Task          `db:"-"                   json:"-"                   o*:"all the tasks that have this task as their tail"`
	// contains filtered or unexported fields
}

Task defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTask

func NewTask() *Task

NewTask is a shortcut to instantiate a new Task

func (*Task) BeforeJSON

func (thisTask *Task) BeforeJSON(loadingID g.LoadingID) g.IEntity

BeforeJSON can arrange an entity that is going to be marshaled in JSON. This arrangement can vary, depending on how the entity has been loaded.

func (*Task) BoolParam

func (thisTask *Task) BoolParam(logger g.ILogger, paramID TaskParameterID, errIfAbsent bool) bool

BoolParam : getting a boolean parameter's value

func (*Task) CanBeUpdated

func (thisTask *Task) CanBeUpdated(biContext g.BiContext, instore g.IEntity) g.Error

CanBeUpdated tells us if the given entity can be updated, and if the changes are acceptable or not

func (*Task) ChangeBeforeInsert

func (thisTask *Task) ChangeBeforeInsert(biContext g.BiContext) g.Error

ChangeBeforeInsert allows to perform specific treatments on the entity before inserting it

func (*Task) ChangeBeforeUpdate

func (thisTask *Task) ChangeBeforeUpdate(biContext g.BiContext) g.Error

ChangeBeforeUpdate allows to perform specific treatments on the entity before updating it

func (*Task) DefineLoadingPlan

func (thisTask *Task) DefineLoadingPlan(loadingID g.LoadingID) g.ILoadingPlan

DefineLoadingPlan : build and returns a loading plan for this entity kind and a loading ID

func (*Task) DoAfterRead

func (thisTask *Task) DoAfterRead(biContext g.BiContext, loadingID g.LoadingID) g.Error

DoAfterRead allows to perform some checks or change right after reading an entity What is done to the entity after reading it may depend on how it's loaded

func (*Task) DurationParam

func (thisTask *Task) DurationParam(logger g.ILogger, paramID TaskParameterID, defaultValue time.Duration) time.Duration

DurationParam : getting a boolean parameter's value

func (*Task) GetAllDependsOn added in v5.6.4

func (thisTask *Task) GetAllDependsOn() []*Task

GetAllDependsOn returns the all tasks that this task depends on

func (*Task) GetAllNextTasks added in v5.6.4

func (thisTask *Task) GetAllNextTasks() []*Task

GetAllNextTasks returns

func (*Task) InitSchema

func (thisTask *Task) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

func (*Task) IntParam

func (thisTask *Task) IntParam(logger g.ILogger, paramID TaskParameterID, defaultValue int) int

IntParam : getting an int parameter's value

func (*Task) LogProgress

func (thisTask *Task) LogProgress(biContext g.BiContext, progress int, commentFmt string, commentArgs ...interface{})

LogProgress allows to indicates how the task is doing during its running; The 'progress' arg must be an integer value between 0 and 100.

func (*Task) NumParam

func (thisTask *Task) NumParam(logger g.ILogger, paramID TaskParameterID, defaultValue float64) float64

NumParam : getting a number parameter's value

func (*Task) String

func (thisTask *Task) String() string

displaying a label for a task

func (*Task) StringParam

func (thisTask *Task) StringParam(logger g.ILogger, paramID TaskParameterID, defaultValue string) string

StringParam : getting a string parameter's value

type TaskActionType

type TaskActionType int

TaskActionType is used to define the specific actions on users

func (TaskActionType) GetActionName

func (thisActionType TaskActionType) GetActionName() string

GetActionName returns a task action label

func (TaskActionType) String

func (thisActionType TaskActionType) String() string

func (TaskActionType) Val

func (thisActionType TaskActionType) Val() int

Val helps implement the IEnum interface

func (TaskActionType) Values

func (thisActionType TaskActionType) Values() map[int]string

Values helps implement the IEnum interface

type TaskConfig

type TaskConfig struct {
	g.Entity                             // is a particular kind of geen entity
	Flow                *TaskFlowConfig  `db:"flow_id"             json:"flow"                i*:"the flow this task is part of"`
	Group               *TaskGroupConfig `db:"group_id"            json:"group"               i*:"the group this task belongs to"`
	Reference           string           `db:"reference,25"        json:"reference"           o*:"the task reference"`
	GlobalReference     string           `` /* 136-byte string literal not displayed */
	Name                string           `db:"name,82"             json:"name"                i*:"the task name"`
	Description         string           `db:"description,255"     json:"description"         in:"the task description"`
	Manual              bool             `db:"manual"              json:"manual"              in:"if true, then this task has to be triggered manually"`
	Intervals           string           `` /* 219-byte string literal not displayed */
	NbParallelIntervals int              `` /* 132-byte string literal not displayed */
	CompactView         bool             `` /* 172-byte string literal not displayed */
	DependsOn           []*TaskConfig    `db:"dependsOn"           json:"dependsOn"           in:"the tasks that must be finished before this one can start"`
	NextTasks           []*TaskConfig    `db:"-"                   json:"nextTasks"           in:"this lists the tasks that depends on this one"`
	Params              []*TaskParameter `db:"-"                   json:"params"              in:"the task's parameters"`
	RunningTasks        []*Task          `db:"-"                   json:"runningTasks"        o*:"the tasks instantiated from this config"`
	FunctionName        TaskFunctionName `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

TaskConfig defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskConfig

func NewTaskConfig() *TaskConfig

NewTaskConfig is a shortcut to instantiate a new TaskConfig

func (*TaskConfig) BeforeJSON

func (thisTask *TaskConfig) BeforeJSON(loadingID g.LoadingID) g.IEntity

BeforeJSON can arrange an entity that is going to be marshaled in JSON. This arrangement can vary, depending on how the entity has been loaded.

func (*TaskConfig) ChangeBeforeInsert

func (thisTaskConfig *TaskConfig) ChangeBeforeInsert(biContext g.BiContext) g.Error

ChangeBeforeInsert allows to perform specific treatments on the entity before inserting it

func (*TaskConfig) ChangeBeforeUpdate

func (thisTaskConfig *TaskConfig) ChangeBeforeUpdate(biContext g.BiContext) g.Error

ChangeBeforeUpdate allows to perform specific treatments on the entity before updating it

func (*TaskConfig) DefineLoadingPlan

func (thisTaskConfig *TaskConfig) DefineLoadingPlan(loadingID g.LoadingID) g.ILoadingPlan

DefineLoadingPlan : build and returns a loading plan for this entity kind and a loading ID

func (*TaskConfig) GetIntervals

func (thisTaskConfig *TaskConfig) GetIntervals() (float64, float64, float64, g.Error)

GetIntervals returns the configuration for "task intervals": a min value, a max, and a step value

func (*TaskConfig) InitSchema

func (thisTaskConfig *TaskConfig) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

func (*TaskConfig) IsValid

func (thisTaskConfig *TaskConfig) IsValid(biContext g.BiContext) g.Error

IsValid is the method through which an entity checks its own validity

func (*TaskConfig) Param

func (thisTaskConfig *TaskConfig) Param(paramID TaskParameterID) *TaskParameter

Param : getting this task's param based on its ID

func (*TaskConfig) ScanForLoop

func (thisTaskConfig *TaskConfig) ScanForLoop() g.Error

ScanForLoop checks that in the dependency chain, this task does not end up depending on itself

type TaskFlow

type TaskFlow struct {
	g.Entity                            // is a particular kind of geen entity
	FlowConfig          *TaskFlowConfig `db:"flowConfig_id"       json:"flowConfig"          i*:"the config this flow is based upon"`
	Name                string          `db:"name,82"             json:"name"                o*:"the task flow name, coming from the config"`
	Reference           string          `` /* 151-byte string literal not displayed */
	ConfigRef           string          `db:"configRef,24"        json:"configRef"           o*:"the flow config's reference"`
	Groups              []*TaskGroup    `db:"-"                   json:"groups"              o*:"the flow's groups, as configured"`
	Tasks               []*Task         `db:"-"                   json:"tasks"               o*:"the flow's tasks, as configured"`
	Status              FlowStatus      `db:"status,2"            json:"status"              o*:"the flow's status"`
	StatusString        string          `db:"-"                   json:"statusString"        o*:"the flow's status as a string"`
	Started             *time.Time      `db:"started,6"           json:"started"             o*:"the starting time of the flow"`
	Finished            *time.Time      `db:"finished,6"          json:"finished"            o*:"the starting time of the flow"`
	MermaidString       string          `db:"-"                   json:"mermaidString"       o*:"a mermaid JS string representing this flow"`
	MaxParallelTasks    int             `` /* 173-byte string literal not displayed */
	RefreshViewEvery    string          `` /* 141-byte string literal not displayed */
	RefreshViewEveryNum int64           `db:"-"                   json:"refreshViewEveryNum" in:"the refreshing period, in seconds"`
	Logs                []*TaskLog      `db:"-"                   json:"logs"                o*:"the logs created during the running of this task"`
	TotalElapsed        string          `db:"-"                   json:"totalElapsed"        o*:"the total time spent from start to finish"`
	CustomReference     string          `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

TaskFlow defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskFlow

func NewTaskFlow() *TaskFlow

NewTaskFlow is a shortcut to instantiate a new TaskFlow

func (*TaskFlow) BeforeJSON

func (thisTaskFlow *TaskFlow) BeforeJSON(loadingID g.LoadingID) g.IEntity

BeforeJSON can arrange an entity that is going to be marshaled in JSON. This arrangement can vary, depending on how the entity has been loaded.

func (*TaskFlow) DefineLoadingPlan

func (thisTaskFlow *TaskFlow) DefineLoadingPlan(loadingID g.LoadingID) g.ILoadingPlan

DefineLoadingPlan : build and returns a loading plan for this entity kind and a loading ID

func (*TaskFlow) DoAfterRead

func (thisTaskFlow *TaskFlow) DoAfterRead(biContext g.BiContext, loadingID g.LoadingID) g.Error

DoAfterRead allows to perform some checks or change right after reading an entity What is done to the entity after reading it may depend on how it's loaded

func (*TaskFlow) InitSchema

func (thisTaskFlow *TaskFlow) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

type TaskFlowConfig

type TaskFlowConfig struct {
	g.Entity                            // is a particular kind of geen entity
	Reference        string             `db:"reference,24"        json:"reference"        i*:"the task flow reference"`
	Name             string             `db:"name,82"             json:"name"             i*:"the task flow name"`
	Description      string             `db:"description,255"     json:"description"      in:"the task flow description"`
	Groups           []*TaskGroupConfig `` /* 135-byte string literal not displayed */
	Tasks            []*TaskConfig      `db:"-"                   json:"tasks"            in:"the tasks contained in this flow"`
	MermaidString    string             `db:"-"                   json:"mermaidString"    o*:"a mermaid JS string representing this flow"`
	RunningFlows     []*TaskFlow        `db:"-"                   json:"runningFlows"     o*:"the flows created from this config"`
	TaskNameMaxWitdh int                `` /* 167-byte string literal not displayed */
	MaxParallelTasks int                `` /* 170-byte string literal not displayed */
	RefreshViewEvery string             `` /* 138-byte string literal not displayed */
}

TaskFlowConfig defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskFlowConfig

func NewTaskFlowConfig() *TaskFlowConfig

NewTaskFlowConfig is a shortcut to instantiate a new TaskFlowConfig

func (*TaskFlowConfig) BeforeJSON

func (thisTaskFlowConfig *TaskFlowConfig) BeforeJSON(loadingID g.LoadingID) g.IEntity

BeforeJSON can arrange an entity that is going to be marshaled in JSON. This arrangement can vary, depending on how the entity has been loaded.

func (*TaskFlowConfig) ChangeBeforeInsert

func (thisTaskFlowConfig *TaskFlowConfig) ChangeBeforeInsert(biContext g.BiContext) g.Error

ChangeBeforeInsert allows to perform specific treatments on the entity before inserting it

func (*TaskFlowConfig) ChangeBeforeUpdate

func (thisTaskFlowConfig *TaskFlowConfig) ChangeBeforeUpdate(biContext g.BiContext) g.Error

ChangeBeforeUpdate allows to perform specific treatments on the entity before updating it

func (*TaskFlowConfig) CompleteInfo

func (thisTaskFlowConfig *TaskFlowConfig) CompleteInfo(recursive bool) g.Error

completing the

func (*TaskFlowConfig) DefineLoadingPlan

func (thisTaskFlowConfig *TaskFlowConfig) DefineLoadingPlan(loadingID g.LoadingID) g.ILoadingPlan

DefineLoadingPlan : build and returns a loading plan for this entity kind and a loading ID

func (*TaskFlowConfig) GetGroup

func (thisTaskFlowConfig *TaskFlowConfig) GetGroup(groupGlobalRef string) *TaskGroupConfig

GetGroup : retrieving a group from a flow with its global ref

func (*TaskFlowConfig) GetTask

func (thisTaskFlowConfig *TaskFlowConfig) GetTask(taskGlobalRef string) *TaskConfig

GetTask : retrieving a task from a flow with its global ref

func (*TaskFlowConfig) InitSchema

func (TaskFlowConfig *TaskFlowConfig) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

func (*TaskFlowConfig) IsValid

func (thisTaskFlowConfig *TaskFlowConfig) IsValid(biContext g.BiContext) g.Error

IsValid is the method through which an entity checks its own validity

func (*TaskFlowConfig) ScanForLoops

func (thisTaskFlowConfig *TaskFlowConfig) ScanForLoops() g.Error

ScanForLoops : checking we don't have a cycle between tasks in this flow

type TaskFunctionName

type TaskFunctionName string

TaskFunctionName : a task function name allows to uniquely refer to a task functions

type TaskGroup

type TaskGroup struct {
	g.Entity                     // is a particular kind of geen entity
	GroupConfig *TaskGroupConfig `db:"groupConfig_id" json:"groupConfig" i*:"the configuration for this group"`
	Flow        *TaskFlow        `db:"flow_id"        json:"flow"        i*:"the flow this group belongs to"`
	Reference   string           `db:"reference,24"   json:"reference"   i*:"remainder of the group reference, coming from the config"`
	Name        string           `db:"name,82"        json:"name"        i*:"remainder of the group name, coming from the config"`
	Tasks       []*Task          `db:"-"              json:"tasks"       in:"the tasks contained in this group"`
}

TaskGroup defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskGroup

func NewTaskGroup() *TaskGroup

NewTaskGroup is a shortcut to instantiate a new TaskGroup

func (*TaskGroup) InitSchema

func (thisTaskGroup *TaskGroup) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

type TaskGroupConfig

type TaskGroupConfig struct {
	g.Entity                        // is a particular kind of geen entity
	Flow            *TaskFlowConfig `db:"flow_id"            json:"flow"            i*:"the flow this group belongs to"`
	Reference       string          `db:"reference,24"       json:"reference"       i*:"the group reference"`
	Name            string          `db:"name,82"            json:"name"            i*:"the group name"`
	GlobalReference string          `` /* 130-byte string literal not displayed */
	Description     string          `db:"description,255"    json:"description"     in:"the group description"`
	Tasks           []*TaskConfig   `db:"-"                  json:"tasks"           in:"the tasks contained in this group"`
	RunningGroups   []*TaskGroup    `db:"-"                  json:"runningGroups"   o*:"the groups instantiated from this config"`
}

TaskGroupConfig defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskGroupConfig

func NewTaskGroupConfig() *TaskGroupConfig

NewTaskGroupConfig is a shortcut to instantiate a new EntityTypeMin

func (*TaskGroupConfig) ChangeBeforeInsert

func (thisTaskGroupConfig *TaskGroupConfig) ChangeBeforeInsert(biContext g.BiContext) g.Error

ChangeBeforeInsert allows to perform specific treatments on the entity before inserting it

func (*TaskGroupConfig) ChangeBeforeUpdate

func (thisTaskGroupConfig *TaskGroupConfig) ChangeBeforeUpdate(biContext g.BiContext) g.Error

ChangeBeforeUpdate allows to perform specific treatments on the entity before updating it

func (*TaskGroupConfig) DefineLoadingPlan

func (thisTaskGroupConfig *TaskGroupConfig) DefineLoadingPlan(loadingID g.LoadingID) g.ILoadingPlan

DefineLoadingPlan : build and returns a loading plan for this entity kind and a loading ID

func (*TaskGroupConfig) InitSchema

func (thisTaskGroupConfig *TaskGroupConfig) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

func (*TaskGroupConfig) IsValid

func (thisTaskGroupConfig *TaskGroupConfig) IsValid(biContext g.BiContext) g.Error

IsValid is the method through which an entity checks its own validity

type TaskLog

type TaskLog struct {
	g.Entity                    // is a particular kind of geen entity
	Flow          *TaskFlow     `db:"flow_id"          json:"flow"          o*:"the flow this is a log for"`
	Task          *Task         `db:"task_id"          json:"task"          o*:"the task this is a log for"`
	TaskRef       string        `db:"taskRef,30"       json:"taskRef"       o*:"the task reference, coming from the task config"`
	TaskName      string        `db:"taskName,128"     json:"taskName"      o*:"the task name, coming from the task config"`
	Progress      int           `db:"progress"         json:"progress"      o*:"the percentage of completion of the task when this log is created"`
	Comment       string        `db:"comment,255"      json:"comment"       o*:"the last comment we know about"`
	Elapsed       time.Duration `db:"elapsed"          json:"elapsed"       o*:"the elapsed time for the task at the time of this log"`
	ElapsedString string        `db:"elapsedString,16" json:"elapsedString" o*:"the elapsed time, as a string"`
}

TaskLog defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskLog

func NewTaskLog() *TaskLog

NewTaskLog is a shortcut to instantiate a new TaskLog

func (*TaskLog) InitSchema

func (thisTaskLog *TaskLog) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

type TaskParameter

type TaskParameter struct {
	g.Entity                        // is a particular kind of geen entity
	Task            *TaskConfig     `db:"task_id"            json:"task"            i*:"the task this parameter is for"`
	ParamID         TaskParameterID `db:"paramID,20"         json:"paramID"         i*:"an ID to uniquely refer to this parameter, within the current task"`
	Value           string          `db:"value,128"          json:"value"           i*:"the parameter value, given as a string"`
	GlobalReference string          `` /* 137-byte string literal not displayed */
}

TaskParameter defines the structure of a ????, i.e. properties & links, plus basic methods

func NewTaskParameter

func NewTaskParameter() *TaskParameter

NewTaskParameter is a shortcut to instantiate a new TaskParameter

func (*TaskParameter) ChangeBeforeInsert

func (thisTaskParameter *TaskParameter) ChangeBeforeInsert(biContext g.BiContext) g.Error

ChangeBeforeInsert allows to perform specific treatments on the entity before inserting it

func (*TaskParameter) ChangeBeforeUpdate

func (thisTaskParameter *TaskParameter) ChangeBeforeUpdate(biContext g.BiContext) g.Error

ChangeBeforeUpdate allows to perform specific treatments on the entity before updating it

func (*TaskParameter) InitSchema

func (thisTaskParameter *TaskParameter) InitSchema() *g.EntitySchema

InitSchema is used to create a schema, to bear all the meta information about this entity type

type TaskParameterID

type TaskParameterID string

TaskParameterID codes a key for a task parameter

type TaskStatus

type TaskStatus int

TaskStatus is used to define the different statuses a flow can have

const (
	TaskStatusERROR    TaskStatus = -2 // the tasks has exited with an error
	TaskStatusSTANDBY  TaskStatus = 0  // the task has been created, but cannot run yet, due to unfinished dependencies
	TaskStatusONGOING  TaskStatus = 5  // the task is currently running
	TaskStatusFINISHED TaskStatus = 9  // the task has successfully finished

)

The flow statuses

func (TaskStatus) String

func (thisTaskStatus TaskStatus) String() string

func (TaskStatus) Val

func (thisTaskStatus TaskStatus) Val() int

Val helps implement the IEnum interface

func (TaskStatus) Values

func (thisTaskStatus TaskStatus) Values() map[int]string

Values helps implement the IEnum interface

Jump to

Keyboard shortcuts

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