Documentation ¶
Overview ¶
Package system expose functions to create and manipulate a Node system.
NOTE: The NodeSystem, once correctly configure, need to be activate in order to work properly.
Index ¶
- type NodeSystem
- func (s *NodeSystem) Activate() error
- func (s *NodeSystem) AddLink(from, to node.Node) (bool, error)
- func (s *NodeSystem) AddLinkOnBranch(from, to node.Node, branch bool) (bool, error)
- func (s *NodeSystem) AddNode(n node.Node) (bool, error)
- func (s *NodeSystem) Ancestors(n node.Node, branch *bool) ([]node.Node, error)
- func (s *NodeSystem) ConfigureJoinModeOnNode(n node.Node, m joinmode.JoinMode) (bool, error)
- func (s *NodeSystem) Equal(o *NodeSystem) bool
- func (s *NodeSystem) Follow(n node.Node, branch *bool) ([]node.Node, error)
- func (s *NodeSystem) InitialNodes() []node.Node
- func (s *NodeSystem) IsActivated() bool
- func (s *NodeSystem) IsValid() (bool, []error)
- func (s *NodeSystem) JoinModeOfNode(n node.Node) joinmode.JoinMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeSystem ¶
type NodeSystem struct {
// contains filtered or unexported fields
}
NodeSystem is a system to configure workflow between action nodes, or decision nodes. The nodes are linked between them by link and join mode options. An activated Node system will be walked throw Follow and Ancestors functions
func New ¶
func New() *NodeSystem
New create an empty Node system who need to be valid and activated in order to be used.
func (*NodeSystem) Activate ¶
func (s *NodeSystem) Activate() error
Activate prepare the node system to be used. In order to activate it, the node system must be valid. Once activated, the initial nodes, following nodes, and ancestors nodes will be accessibles.
func (*NodeSystem) AddLink ¶
func (s *NodeSystem) AddLink(from, to node.Node) (bool, error)
AddLink add a link from a node to another node into the system before activation.
func (*NodeSystem) AddLinkOnBranch ¶
AddLinkOnBranch add a link from a node (on a specific branch) to another node into the system before activation.
func (*NodeSystem) AddNode ¶
func (s *NodeSystem) AddNode(n node.Node) (bool, error)
AddNode add a node to the system before activation.
func (*NodeSystem) Ancestors ¶
Ancestors get the set of nodes who access using one of their branch to a specific node after activation.
func (*NodeSystem) ConfigureJoinModeOnNode ¶
ConfigureJoinModeOnNode configure the join mode of a node into the system before activation.
func (*NodeSystem) Equal ¶
func (s *NodeSystem) Equal(o *NodeSystem) bool
Equal validate the two NodeSystem are equals.
func (*NodeSystem) Follow ¶
Follow get the set of nodes accessible from a specific node and one of its branch after activation.
func (*NodeSystem) InitialNodes ¶
func (s *NodeSystem) InitialNodes() []node.Node
InitialNodes get the initial nodes
func (*NodeSystem) IsActivated ¶
func (s *NodeSystem) IsActivated() bool
IsActivated give the activation state of the node system. Only true if the node system is valid and have run the activate function without errors.
func (*NodeSystem) IsValid ¶
func (s *NodeSystem) IsValid() (bool, []error)
IsValid check if the configuration of the node system is valid based on checks. Check for decision node with any node links as from, check for cyclic redundancy in node links, check for undeclared node used in node links, check for multiple declaration of same node instance.
func (*NodeSystem) JoinModeOfNode ¶
func (s *NodeSystem) JoinModeOfNode(n node.Node) joinmode.JoinMode
JoinModeOfNode get the configured join mode of a node