Class FlowGraphEndPoint.Returning

  • All Implemented Interfaces:
    INodeKeyProviding, Serializable
    Enclosing class:
    FlowGraphEndPoint

    public static final class FlowGraphEndPoint.Returning
    extends FlowGraphEndPoint
    A special type of FlowGraphEndPoint, used when analyzing the control flow of a workflow processing chain.

    A returning end point is a node that can complete abruptly by issuing a return statement and does not always transfer control to the node or a child of the node when it completes normally. For example, a return statement is usually a returning end point, unless handled e.g. by a finally block of a try-finally statement.

    More formally, given a syntax tree of nodes representing the parent-child relationship, the returning 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 return statement; and
    • (c) m does not always transfer control to a node in the subtree of n when m completes abruptly by throwing an exception.

    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 may 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 return statement that only returns when some condition is fulfilled, and completes normally otherwise.

    Condition (c) is required for cases such as a try-finally statements, where no node within the try block can be a returning end point with respect to the try-finally statement, as control is always transferred to the finally block when a node within the try block completes abruptly by returning an exception.

    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form