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>>
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJPA attribute name for thegetChildren()field.static final StringJPA attribute name for thegetParent()field.static final StringDatabase column name for thegetParent()field.static final StringThe index at which this entity appear ingetChildren().Fields inherited from class AWorkflowElement
active, ATTR_ACTIVE, ATTR_CUSTOM_PARAMETERS, ATTR_CUSTOM_PARAMETERS_VERSION, ATTR_DESCRIPTION, ATTR_SEARCH_TERMS, ATTR_TASK, ATTR_TYPE, COL_ACTIVE, COL_CUSTOM_PARAMETERS, COL_CUSTOM_PARAMETERS_VERSION, COL_DESCRIPTION, COL_NAME, COL_TASK, COL_TYPE, customParameters, customParametersVersion, description, name, searchTerms, task, type, uuidFields inherited from class AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersionFields inherited from class AbstractEntity
COL_ID, idFields inherited from interface IDescriptionProviding
ATTR_BESCHREIBUNGFields inherited from interface de.xima.cmn.dao.interfaces.IEntity
ATTR_IDFields inherited from interface de.xima.cmn.dao.interfaces.ILockableEntity
ATTR_LOCKINGVERSIONFields inherited from interface INameProviding
ATTR_NAMEFields inherited from interface ITransferableEntity
IMPORT_ID, INVALID_IDFields inherited from interface IUUIDEntity
ATTR_UUID, COL_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, NULLABLE_UUID_TYPE, TYPE_NAME_UUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(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.voidaddChild(WorkflowNode child) Adds a child node to the tail of the existing children, and sets the parent of the given node to this node.Gets the list of child nodes, i.e. the nodes that have this node set as theirparent.getId()getKey()Gets parent of this node, i.e. the node that contains this node in itschildren.voidputSearchTerm(WorkflowNodeSearchTerm searchTerm) Adds the given search term to this element, and setsAWorkflowElementSearchTerm.getElement()to this element.voidsetChildren(List<WorkflowNode> children) Sets the list of child nodes, i.e. the nodes that have this node set as theirparent.voidsetParent(WorkflowNode parent) Sets parent of this node, i.e. the node that contains this node in itschildren.toString()Methods inherited from class AWorkflowElement
cloneBasics, getBeschreibung, getCustomParameters, getCustomParametersVersion, getDescription, getName, getTask, getType, getUuid, getUUID, getUUIDObject, isActive, setActive, setCustomParameters, setCustomParametersVersion, setDescription, setName, setSearchTerms, setTask, setType, setUUID, setUUIDObjectMethods inherited from class AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersionMethods inherited from class AbstractEntity
asIntValue, isPersisted, setId, setIdMethods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCodeMethods inherited from interface Comparable
compareToMethods inherited from interface ICustomParametersProviding
getCustomParametersJsonMethods inherited from interface de.xima.cmn.dao.interfaces.IEntity
isPersisted, setIdMethods inherited from interface IWorkflowElementEntity
setCustomParametersJsonMethods inherited from interface IWorkflowElementTypeProviding
getType
-
Field Details
-
ATTR_CHILDREN
-
ATTR_PARENT
-
COL_PARENT
-
COL_PARENT_ORDER_INDEX
The index at which this entity appear ingetChildren().- See Also:
-
-
Constructor Details
-
WorkflowNode
public WorkflowNode()
-
-
Method Details
-
addChild
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 than0, the (current length of the children + 1) is added (-1appends the item to the end of the list,-2inserts 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
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
Gets the list of child nodes, i.e. the nodes that have this node set as theirparent. Which and how many children a node must or can have depends on thetypeof this node. SeeEWorkflowNodeKindfor 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
- Specified by:
getIdin interfacede.xima.cmn.dao.interfaces.IEntity<Long>- Specified by:
getIdin interfaceIIdProviding<Long>- Returns:
- The ID that identifies this instance.
-
getKey
- Specified by:
getKeyin interfaceIElementKeyProviding- Returns:
- The key that identifies this instance.
-
getNodeKey
- Specified by:
getNodeKeyin interfaceINodeKeyProviding- Returns:
- The node key that identifies this instance.
-
getParent
Gets parent of this node, i.e. the node that contains this node in itschildren. The parent may be null if and only if it is the root node, i.e. the node pointed to byWorkflowTask.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
- Specified by:
getSearchTermsin interfaceIElementSearchTermsProviding- Returns:
- The search terms that were defined for this workflow element.
-
putSearchTerm
Adds the given search term to this element, and setsAWorkflowElementSearchTerm.getElement()to this element.- Parameters:
searchTerm- The search term to add to this element.
-
setChildren
Sets the list of child nodes, i.e. the nodes that have this node set as theirparent. Which and how many children a node must or can have depends on thetypeof this node. SeeEWorkflowNodeKindfor 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
Sets parent of this node, i.e. the node that contains this node in itschildren. The parent may be null if and only if it is the root node, i.e. the node pointed to byWorkflowTask.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
- Overrides:
toStringin classAbstractLockableEntity
-