workflowmodel

package module
v0.0.0-...-eac04f7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 2 Imported by: 2

README

workflow-model-go

A model for workflow systems using in NWPC.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bunch

type Bunch struct {
	Node
}

func (*Bunch) AddNode

func (bunch *Bunch) AddNode(path string) *Node

func (*Bunch) AddNodeStatus

func (bunch *Bunch) AddNodeStatus(record NodeStatusRecord) *Node

func (*Bunch) FindNode

func (bunch *Bunch) FindNode(path string) *Node

type Node

type Node struct {
	Name     string
	Parent   *Node
	Children []*Node
	Status   NodeStatus
}

func (*Node) AddChild

func (node *Node) AddChild(child *Node)

func (Node) MarshalJSON

func (node Node) MarshalJSON() ([]byte, error)

func (*Node) NodePath

func (node *Node) NodePath() string

func (*Node) UnmarshalJSON

func (node *Node) UnmarshalJSON(b []byte) error

type NodeStatus

type NodeStatus uint
const (
	Unknown NodeStatus = iota
	Suspended
	Complete
	Queued
	Submitted
	Active
	Aborted
	Shutdown
	Halted
	Running
)

func GetNodeStatus

func GetNodeStatus(status string) NodeStatus

func (NodeStatus) String

func (status NodeStatus) String() string

type NodeStatusEqualValueChecker

type NodeStatusEqualValueChecker struct {
	ExpectedValue NodeStatus
}

func (*NodeStatusEqualValueChecker) CheckValue

func (c *NodeStatusEqualValueChecker) CheckValue(s NodeStatus) bool

type NodeStatusInValueChecker

type NodeStatusInValueChecker struct {
	ExpectedValues []NodeStatus
}

func (*NodeStatusInValueChecker) CheckValue

func (c *NodeStatusInValueChecker) CheckValue(s NodeStatus) bool

type NodeStatusRecord

type NodeStatusRecord struct {
	Path   string
	Status string
}

type NodeStatusValueChecker

type NodeStatusValueChecker interface {
	CheckValue(status NodeStatus) bool
}

type NodeType

type NodeType uint
const (
	UnknownNodeType NodeType = iota
	Root
	Suite
	Family
	Task
	Alias
	NonTaskNode
	Meter
)

func GetNodeType

func GetNodeType(s string) NodeType

func (NodeType) String

func (nodeType NodeType) String() string

type NodeVariable

type NodeVariable struct {
	Name  string           `json:"name"`
	Value string           `json:"value"`
	Type  NodeVariableType `json:"type"`
}

type NodeVariableType

type NodeVariableType uint
const (
	Variable NodeVariableType = iota
	GeneratedVariable
)

type StringEqualValueChecker

type StringEqualValueChecker struct {
	ExpectedValue string
}

func (*StringEqualValueChecker) CheckValue

func (c *StringEqualValueChecker) CheckValue(s string) bool

type StringInValueChecker

type StringInValueChecker struct {
	ExpectedValues []string
}

func (*StringInValueChecker) CheckValue

func (c *StringInValueChecker) CheckValue(s string) bool

type StringValueChecker

type StringValueChecker interface {
	CheckValue(s string) bool
}

type WorkflowNode

type WorkflowNode struct {
	Name                  string                  `json:"name"`
	Status                NodeStatus              `json:"status"`
	Type                  NodeType                `json:"node_type"`
	VariableList          WorkflowNodeVariables   `json:"variable_list"`
	InheritedVariableList []WorkflowNodeVariables `json:"inherited_variable_list"`
}

func (*WorkflowNode) GetVariable

func (node *WorkflowNode) GetVariable(name string) *NodeVariable

type WorkflowNodeCondition

type WorkflowNodeCondition interface {
	IsFit(node *WorkflowNode) bool
}

type WorkflowNodeStatusCondition

type WorkflowNodeStatusCondition struct {
	Checker NodeStatusValueChecker
}

func (*WorkflowNodeStatusCondition) IsFit

type WorkflowNodeVariableCondition

type WorkflowNodeVariableCondition struct {
	VariableName string
	Checker      StringValueChecker
}

func (*WorkflowNodeVariableCondition) IsFit

type WorkflowNodeVariables

type WorkflowNodeVariables struct {
	Path                  string         `json:"path"`
	VariableList          []NodeVariable `json:"variable_list"`
	GeneratedVariableList []NodeVariable `json:"generated_variable_list"`
}

func (*WorkflowNodeVariables) GetVariable

func (vars *WorkflowNodeVariables) GetVariable(name string) *NodeVariable

Jump to

Keyboard shortcuts

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