Class FlowGraphEndPoint.ControlTransfer
- java.lang.Object
-
- de.xima.fc.mdl.workflow.FlowGraphEndPoint
-
- de.xima.fc.mdl.workflow.FlowGraphEndPoint.ControlTransfer
-
- All Implemented Interfaces:
INodeKeyProviding
,Serializable
- Enclosing class:
- FlowGraphEndPoint
public static final class FlowGraphEndPoint.ControlTransfer extends FlowGraphEndPoint
A special type ofFlowGraphEndPoint
, used when analyzing the control flow of a workflow processing chain.A control transfer end point is a node that can
complete abruptly
byissuing 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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.xima.fc.mdl.workflow.FlowGraphEndPoint
FlowGraphEndPoint.ControlTransfer, FlowGraphEndPoint.Normal, FlowGraphEndPoint.Returning, FlowGraphEndPoint.Throwing
-
-
Field Summary
-
Fields inherited from class de.xima.fc.mdl.workflow.FlowGraphEndPoint
nodeKey
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getControlTransferType()
NodeKey
getTarget()
int
hashCode()
boolean
isValidTarget(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.String
toString()
-
Methods inherited from class de.xima.fc.mdl.workflow.FlowGraphEndPoint
controlTransfer, getNodeKey, normal, returning, throwing
-
-
-
-
Method Detail
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in classFlowGraphEndPoint
-
getControlTransferType
public String getControlTransferType()
- Returns:
- Type of the control transfer, see
EStandardControlTransferType
for a list of built-in transfer types.
-
getTarget
public NodeKey getTarget()
- Returns:
- The target node of the control transfer.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classFlowGraphEndPoint
-
isValidTarget
public boolean isValidTarget(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. A node is valid target if eithertarget
isnull
or thetarget
equals 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:
true
if the given node is a valid target for the given control transfer end point,false
otherwise.- Since:
- 8.2.0
-
-