Class WorkflowNode
- java.lang.Object
-
- de.xima.cmn.dao.model.AEntity<Long>
-
- de.xima.fc.entities.AbstractEntity
-
- de.xima.fc.entities.AbstractLockableEntity
-
- de.xima.fc.entities.AWorkflowElement<WorkflowNode,WorkflowNodeSearchTerm>
-
- de.xima.fc.entities.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>>
@Entity public class WorkflowNode extends AWorkflowElement<WorkflowNode,WorkflowNodeSearchTerm> implements IWorkflowNodeTypeProviding, INodeKeyProviding
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 thegetParent()
andgetChildren()
relations must be a tree.Which and how many children a node must or can have depends on the
type
of this node. SeeEWorkflowNodeKind
for a list of built-in nodes.Each
WorkflowTask
represents a processing chain, with aroot 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_CHILDREN
JPA attribute name for thegetChildren()
field.static String
ATTR_PARENT
JPA attribute name for thegetParent()
field.static String
COL_PARENT
Database column name for thegetParent()
field.static String
COL_PARENT_ORDER_INDEX
The index at which this entity appear ingetChildren()
.-
Fields inherited from class de.xima.fc.entities.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, uuid
-
Fields inherited from class de.xima.fc.entities.AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersion
-
Fields inherited from class de.xima.fc.entities.AbstractEntity
COL_ID, id
-
Fields inherited from interface de.xima.fc.entities.interfaces.IDescriptionProviding
ATTR_BESCHREIBUNG
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
Fields inherited from interface de.xima.fc.entities.interfaces.IUUIDEntity
ATTR_UUID, COL_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, NULLABLE_UUID_TYPE, TYPE_NAME_UUID
-
-
Constructor Summary
Constructors Constructor Description WorkflowNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.List<WorkflowNode>
getChildren()
Gets the list of child nodes, i.e.Long
getId()
ElementKey
getKey()
NodeKey
getNodeKey()
WorkflowNode
getParent()
Gets parent of this node, i.e.List<WorkflowNodeSearchTerm>
getSearchTerms()
void
putSearchTerm(WorkflowNodeSearchTerm searchTerm)
Adds the given search term to this element, and setsAWorkflowElementSearchTerm.getElement()
to this element.void
setChildren(List<WorkflowNode> children)
Sets the list of child nodes, i.e.void
setParent(WorkflowNode parent)
Sets parent of this node, i.e.String
toString()
-
Methods inherited from class de.xima.fc.entities.AWorkflowElement
cloneBasics, getBeschreibung, getCustomParameters, getCustomParametersVersion, getDescription, getName, getTask, getType, getUuid, getUUID, getUUIDObject, isActive, setActive, setCustomParameters, setCustomParametersVersion, setDescription, setName, setSearchTerms, setTask, setType, setUUID, setUUIDObject
-
Methods inherited from class de.xima.fc.entities.AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion
-
Methods inherited from class de.xima.fc.entities.AbstractEntity
asIntValue, isPersisted, setId, setId
-
Methods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface de.xima.fc.interfaces.workflow.ICustomParametersProviding
getCustomParametersJson
-
Methods inherited from interface de.xima.fc.interfaces.workflow.IWorkflowElementEntity
setCustomParametersJson
-
Methods inherited from interface de.xima.fc.interfaces.workflow.IWorkflowElementTypeProviding
getType
-
-
-
-
Field Detail
-
ATTR_CHILDREN
public static final String ATTR_CHILDREN
JPA attribute name for thegetChildren()
field.- See Also:
- Constant Field Values
-
ATTR_PARENT
public static final String ATTR_PARENT
JPA attribute name for thegetParent()
field.- See Also:
- Constant Field Values
-
COL_PARENT
public static final String COL_PARENT
Database column name for thegetParent()
field.- See Also:
- Constant Field Values
-
COL_PARENT_ORDER_INDEX
public static final String COL_PARENT_ORDER_INDEX
The index at which this entity appear ingetChildren()
.- See Also:
- Constant Field Values
-
-
Method Detail
-
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 than0
, 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 theirparent
. Which and how many children a node must or can have depends on thetype
of this node. SeeEWorkflowNodeKind
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:
getParent()
-
getId
public Long getId()
- Specified by:
getId
in interfacede.xima.cmn.dao.interfaces.IEntity<Long>
- Specified by:
getId
in interfaceIIdProviding<Long>
- Returns:
- The ID that identifies this instance.
-
getKey
public ElementKey getKey()
- Specified by:
getKey
in interfaceIElementKeyProviding
- Returns:
- The key that identifies this instance.
-
getNodeKey
public NodeKey getNodeKey()
- Specified by:
getNodeKey
in interfaceINodeKeyProviding
- 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 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:
getChildren()
-
getSearchTerms
public List<WorkflowNodeSearchTerm> getSearchTerms()
- Specified by:
getSearchTerms
in interfaceIElementSearchTermsProviding
- 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 setsAWorkflowElementSearchTerm.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 theirparent
. Which and how many children a node must or can have depends on thetype
of this node. SeeEWorkflowNodeKind
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:
getParent()
-
setParent
public void setParent(WorkflowNode parent)
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
public String toString()
- Overrides:
toString
in classAbstractLockableEntity
-
-