Class FlowGraphEndPoint.ControlTransfer
- All Implemented Interfaces:
INodeKeyProviding, Serializable
- Enclosing class:
FlowGraphEndPoint
FlowGraphEndPoint, used when analyzing the control flow of a workflow processing chain.
A control transfer end point is a node that can
complete abruptly by
issuing a control transfer statement and does not always transfer control
to the node or a child of the node when it completes abruptly by issuing a control transfer statement. For
example, break or continue statement always transfer control to an enclosing loop.
More formally, given a syntax tree of nodes representing their parent-child relationship, the control transfer end points of a node n are the set of all nodes {m} such that all of the following hold:
- (a) m is in the subtree of n,
- (b) m can potentially (but might not always) complete abruptly by issuing a control transfer statement ; and
- (c) m does not always transfer control to a node in the subtree of n when m completes abruptly by issuing a control transfer statement.
The subtree of a node n is set of all nodes {m} that are either equal to n or have n as one of their parents.
Condition (a) follows from the hierarchical execution principle of the workflow engine. A node, when asked to execute, may choose to execute some of its children in its subtree depending on the circumstances (such as an if-else statement that execute one of its two children depending on the outcome of a condition); but must never execute any other nodes outside its subtree. This implies that nodes can never transfer control to any node outside its subtree.
Condition (b) allows for other types of completion. A node is allowed to complete in other manners depending on the circumstances, such as a conditional break statement that only break a loop when some condition is fulfilled.
Condition (c) is required for cases such as a while-loop statements, where no node within the loop body which targets that loop can be a break or continue control-transferring end point with respect to the while-loop statement, as control is always transferred back to the beginning or end of the loop body when a node within the loop body completes abruptly by issuing a breaking or continuing control transfer.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class FlowGraphEndPoint
FlowGraphEndPoint.ControlTransfer, FlowGraphEndPoint.Normal, FlowGraphEndPoint.Returning, FlowGraphEndPoint.Throwing -
Field Summary
Fields inherited from class FlowGraphEndPoint
nodeKey -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanisValidTarget(NodeKey nodeKey, String... types) Checks whether this control transfer end points has one of the given types, and is a valid target for the given node.toString()Methods inherited from class FlowGraphEndPoint
controlTransfer, getNodeKey, normal, returning, throwing
-
Method Details
-
equals
- Specified by:
equalsin classFlowGraphEndPoint
-
getControlTransferType
- Returns:
- Type of the control transfer, see
EStandardControlTransferTypefor a list of built-in transfer types.
-
getTarget
- Returns:
- The target node of the control transfer.
-
hashCode
public int hashCode()- Specified by:
hashCodein classFlowGraphEndPoint
-
isValidTarget
Checks whether this control transfer end points has one of the given types, and is a valid target for the given node. A node is valid target if eithertargetisnullor thetargetequals the given node key.- Parameters:
nodeKey- Key of a candidate node to check whether it is a valid target.types- Control transfer types to match against.- Returns:
trueif the given node is a valid target for the given control transfer end point,falseotherwise.- Since:
- 8.2.0
-
toString
-