Class WorkflowNode

All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>, de.xima.cmn.dao.interfaces.ILockableEntity<Long>, IDescriptionProviding, ILockingVersionProviding, INameProviding, ITransferable, ITransferableEntity, ITransferableLockableEntity, IUUIDEntity, IActiveFlagProviding, ICustomParametersProviding, IElementKeyProviding, IElementSearchTermsProviding, IIdProviding<Long>, INodeKeyProviding, IUuidProviding, IVersionedCustomParametersProviding, IWorkflowElementEntity, IWorkflowElementTypeProviding, IWorkflowNodeTypeProviding, Serializable, Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>

A workflow node that represents a statement in a workflow task. Each node can be thought of as a statement node in the syntax tree of a structured program. The graph formed by the getParent() and getChildren() relations must be a tree.

Which and how many children a node must or can have depends on the type of this node. See EWorkflowNodeKind for a list of built-in nodes.

Each WorkflowTask represents a processing chain, with a root node that represents the start of the processing chain. The root node has no parent, but usually has one or more children. All nodes of a task form a tree structure, rooted at the root node. This tree structure models the syntax tree of a structured program, where each node represents a statement in the program.

When the workflow engine executes a task, it starts at the root node. Each node is responsible for executing itself and possibly asking the workflow engine to execute its children. Nodes without children are usually business logic tasks that perform some action (e.g. a send email action); nodes with children are usually flow control nodes that control the flow of execution (e.g. a block statement, an if-else statement, or a try-catch statement).

Since:
7.0.0
Author:
XIMA MEDIA GmbH
See Also:
  • Field Details

  • Constructor Details

    • WorkflowNode

      public WorkflowNode()
  • Method Details

    • addChild

      public void addChild(int index, WorkflowNode child)
      Adds a child node to the tail of the existing children, and sets the parent of the given node to this node. Each child may have children of its own, forming a tree structure representing the syntax tree of a structured program.
      Parameters:
      index - Position at which to add the child. When smaller than 0, the (current length of the children + 1) is added (-1 appends the item to the end of the list, -2 inserts the item as the second to last position etc.). Afterward, the index is clamped to the range [0, children.size()], so that no index out of bound exceptions can occur.
      child - The child node to add.
    • addChild

      public void addChild(WorkflowNode child)
      Adds a child node to the tail of the existing children, and sets the parent of the given node to this node. Each child may have children of its own, forming a tree structure representing the syntax tree of a structured program.
      Parameters:
      child - The child node to add.
    • getChildren

      public List<WorkflowNode> getChildren()
      Gets the list of child nodes, i.e. the nodes that have this node set as their parent. Which and how many children a node must or can have depends on the type of this node. See EWorkflowNodeKind for a list of built-in nodes. Each child may have children of its own, forming a tree structure representing the syntax tree of a structured program.
      Returns:
      The children of this node.
      See Also:
    • getId

      public Long getId()
      Specified by:
      getId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      Specified by:
      getId in interface IIdProviding<Long>
      Returns:
      The ID that identifies this instance.
    • getKey

      public ElementKey getKey()
      Specified by:
      getKey in interface IElementKeyProviding
      Returns:
      The key that identifies this instance.
    • getNodeKey

      public NodeKey getNodeKey()
      Specified by:
      getNodeKey in interface INodeKeyProviding
      Returns:
      The node key that identifies this instance.
    • getParent

      public WorkflowNode getParent()
      Gets parent of this node, i.e. the node that contains this node in its children. The parent may be null if and only if it is the root node, i.e. the node pointed to by WorkflowTask.getRootNode().

      Each parent may have another parent, forming a tree structure representing the syntax tree of a structured program.

      Returns:
      The parent of this node, or null if this node is a root node.
      See Also:
    • getSearchTerms

      public List<WorkflowNodeSearchTerm> getSearchTerms()
      Specified by:
      getSearchTerms in interface IElementSearchTermsProviding
      Returns:
      The search terms that were defined for this workflow element.
    • putSearchTerm

      public void putSearchTerm(WorkflowNodeSearchTerm searchTerm)
      Adds the given search term to this element, and sets AWorkflowElementSearchTerm.getElement() to this element.
      Parameters:
      searchTerm - The search term to add to this element.
    • setChildren

      public void setChildren(List<WorkflowNode> children)
      Sets the list of child nodes, i.e. the nodes that have this node set as their parent. Which and how many children a node must or can have depends on the type of this node. See EWorkflowNodeKind for a list of built-in nodes. Each child may have children of its own, forming a tree structure representing the syntax tree of a structured program.
      Parameters:
      children - A list of child nodes.
      See Also:
    • setParent

      public void setParent(WorkflowNode parent)
      Sets parent of this node, i.e. the node that contains this node in its children. The parent may be null if and only if it is the root node, i.e. the node pointed to by WorkflowTask.getRootNode(). Each parent may have another parent, forming a tree structure representing the syntax tree of a structured program.
      Parameters:
      parent - The parent of this node.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLockableEntity