{"modulePath":"github.com/AliceO2Group/Control","version":"v1.51.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package workflow\n\nPackage workflow defines the Role interface, along with tooling to build the control tree. A workflow is a tree of Roles, and it's loaded from Configuration with a combination of YAML unmarshaling and Go template execution.\n\n## Constants\n\n```go\nconst (\n\tPATH_SEPARATOR      = \".\"\n\tPATH_SEPARATOR_RUNE = '.'\n)\n```\n\n## Functions\n\n```go\nfunc GetActiveTasks(r Role) task.Tasks\n```\n\n```go\nfunc Graft(root *yaml.Node, path string, toAdd []byte, graftedName string) (out []byte, err error)\n```\nGraft takes a root node, a path to a role in root, byte array with an existing role and appends this role asa child of the role in root where the path specifies.\n\n```go\nfunc LeafWalk(root Role, do func(role Role))\n```\n\n```go\nfunc LinkChildrenToParents(root Role)\n```\nLinkChildrenToParents walks through the role tree and sets the correct parent for each child\n\n```go\nfunc LoadWorkflow(in []byte) (out yaml.Node, err error)\n```\n\n```go\nfunc MakeDisabledRoleCallback(r Role) func(stage template.Stage, err error) error\n```\n\n```go\nfunc RoleToYAML(input Role) ([]byte, error)\n```\nRoleToYAML exists to avoid exporting aggregatorRole/iteratorRole. Simply put, this function is nothing but a wrapper which allows marshalling Roles outside the workflow package\n\n```go\nfunc Walk(root Role, do func(role Role))\n```\n\n```go\nfunc WrapConstraints(items constraint.Constraints) template.Fields\n```\n\n## Types\n\n```go\ntype GetCurrentRunNumberFunc func() uint32\n```\n\n```go\ntype GetEnvIdFunc func() uid.ID\n```\n\n```go\ntype GetStringMapFunc func() gera.Map[string, string]\n```\n\n```go\ntype LoadSubworkflowFunc func(workflowPathExpr string, parent Updatable) (root *aggregatorRole, workflowRepo repos.IRepo, err error)\n```\n\n```go\ntype ParentAdapter struct {\n\tSendEvents SendEvents\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewParentAdapter(getEnvId GetEnvIdFunc,\n\tgetCurrentRunNumber GetCurrentRunNumberFunc,\n\tgetDefaults GetStringMapFunc,\n\tgetVars GetStringMapFunc,\n\tgetUserVars GetStringMapFunc,\n\tSendEvents SendEvents) *ParentAdapter\n```\n\n```go\nfunc (*ParentAdapter) CollectInboundChannels() []channel.Inbound\n```\n\n```go\nfunc (*ParentAdapter) CollectOutboundChannels() []channel.Outbound\n```\n\n```go\nfunc (p *ParentAdapter) GetCurrentRunNumber() uint32\n```\n\n```go\nfunc (p *ParentAdapter) GetDefaults() gera.Map[string, string]\n```\n\n```go\nfunc (p *ParentAdapter) GetEnvironmentId() uid.ID\n```\n\n```go\nfunc (p *ParentAdapter) GetParent() Updatable\n```\n\n```go\nfunc (*ParentAdapter) GetPath() string\n```\n\n```go\nfunc (p *ParentAdapter) GetUserVars() gera.Map[string, string]\n```\n\n```go\nfunc (p *ParentAdapter) GetVars() gera.Map[string, string]\n```\n\n```go\nfunc (p *ParentAdapter) SendEvent(ev event.Event)\n```\n\n```go\nfunc (p *ParentAdapter) SubscribeToStateChange(subscriptionId string, c chan sm.State)\n```\n\n```go\nfunc (p *ParentAdapter) SubscribeToStatusChange(subscriptionId string, c chan task.Status)\n```\n\n```go\nfunc (p *ParentAdapter) UnsubscribeFromStateChange(subscriptionId string)\n```\n\n```go\nfunc (p *ParentAdapter) UnsubscribeFromStatusChange(subscriptionId string)\n```\n\n```go\ntype PublicUpdatable interface {\n\tUpdateStatus(s task.Status)\n\tUpdateState(s sm.State)\n}\n```\n\n```go\ntype Role interface {\n\tVarNode\n\tGetParent() Updatable\n\tGetParentRole() Role\n\tGetRootRole() Role\n\tGetRoles() []Role\n\tGetPath() string\n\tGetName() string\n\tGetStatus() task.Status\n\tGetState() sm.State\n\tGetTasks() task.Tasks\n\tGetTaskClasses() []string\n\tGenerateTaskDescriptors() task.Descriptors\n\n\tProcessTemplates(workflowRepo repos.IRepo, loadSubworkflow LoadSubworkflowFunc, baseConfigStack map[string]string) error\n\tGlobFilter(g glob.Glob) []Role\n\tSetRuntimeVar(key string, value string)\n\tSetRuntimeVars(kv map[string]string)\n\tDeleteRuntimeVar(key string)\n\tDeleteRuntimeVars(keys []string)\n\tGetHooksMapForTrigger(trigger string) callable.HooksMap\n\tGetAllHooks() callable.Hooks\n\tIsEnabled() bool\n\tGetCurrentRunNumber() uint32\n\tConsolidatedVarStack() (varStack map[string]string, err error)\n\tConsolidatedVarMaps() (defaults, vars, userVars map[string]string, err error)\n\tGetEnvironmentId() uid.ID\n\tIsCritical() bool\n\t// contains filtered or unexported methods\n}\n```\n\n```go\nfunc GetRoot(role Role) (root Role)\n```\n\n```go\nfunc Load(workflowPath string, parent Updatable, taskManager *task.Manager, userProperties map[string]string, baseConfigStack map[string]string) (workflow Role, err error)\n```\nFIXME: workflowPath should be of type configuration.Path, not string\n\n```go\nfunc LoadDPL(tasks []*taskclass.Class, rootRoleName string, extraVarsMap map[string]string) (workflow Role, err error)\n```\n\n```go\nfunc NewAggregatorRole(name string, roles []Role) (r Role)\n```\n\n```go\nfunc NewCallRole(name string, traits task.Traits, funcCall string, returnVar string) (r Role)\n```\n\n```go\ntype SafeState struct {\n\t// contains filtered or unexported fields\n}\n```\nSafeState is a thread-safe structure that holds the state of a role.\n\n```go\ntype SafeStatus struct {\n\t// contains filtered or unexported fields\n}\n```\nSafeStatus is a thread-safe structure that holds the status of a role.\n\n```go\ntype SendEvents func(event.Event)\n```\n\n```go\ntype Updatable interface {\n\tVarNode\n\tGetParent() Updatable\n\n\tGetEnvironmentId() uid.ID\n\tGetPath() string\n\tCollectOutboundChannels() []channel.Outbound\n\tCollectInboundChannels() []channel.Inbound\n\tSendEvent(event.Event)\n\tGetCurrentRunNumber() uint32\n\t// contains filtered or unexported methods\n}\n```\n\n```go\ntype VarNode interface {\n\tGetDefaults() gera.Map[string, string]\n\tGetVars() gera.Map[string, string]\n\tGetUserVars() gera.Map[string, string]\n}\n```\n\n","path":"github.com/AliceO2Group/Control/core/workflow","name":"workflow","synopsis":"Package workflow defines the Role interface, along with tooling to build the control tree.","isRedistributable":true}
