Interface IExecutingLikeExceptionHandlerNode<TData>

Type Parameters:
TData - Type of the node's properties model.
All Superinterfaces:
ICustomParametersUpdateable, IElementHandler<TData, WorkflowNode>, IExecutionResultDescriptor, INodeHandler<TData>, IRefinedExecutionResultDescriptor<TData>, IResourceBundleLocator, IWorkflowElementTypeProviding, IWorkflowNodeFlowAnalyzer<TData>, IWorkflowNodeTypeProviding
All Known Implementing Classes:
FcExperimentHandler

public interface IExecutingLikeExceptionHandlerNode<TData> extends INodeHandler<TData>
Mixin with the implementation of createFlowGraph for node handlers that attempt to execute its body child node, and run another child if the child completed abruptly by throwing an exception, optionally always running a finalizer block at the end, such as a try-catch(-finally) block.

The semantics for the finalizer block are as specified by the Java language spec. In particular, when the finalizer completes abruptly in any manner (such as by throwing an exception or by issuing a control transfer or return statement), that abrupt completion result always replaces the completion result of the try-catch block. For example, the code below returns 10 and does not throw an exception.

int foobar() throws Exception {
  var i = 0;
  loop: while (++i < 10) {
    try {
      throw new Error("42");
    }
    finally {
      continue loop;
    }
  }
  return i;
}
Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • createFlowGraph

      default <TElement extends IWorkflowNodeTypeProviding & IActiveFlagProviding> IFlowGraphEndPoints createFlowGraph(ICreateFlowGraphParams<TData,TElement> params) throws WorkflowAnalysisException
      Description copied from interface: IWorkflowNodeFlowAnalyzer
      This method is used to create the flow graph that represents the control flow of a workflow task, and to determine the end points of the node when executed. A flow graph constructed by the workflow engine and used for the purpose of deriving statements about the runtime behavior of the program represented by a workflow task with a root node.

      See below for details on how to construct a flow graph. However, note that unless you are creating a new custom flow control node, you should use on of the existing mixins that matches the type of node you are creating:

      The flow graph is a directed graph. Each node in the control flow graph is either

      The graph has an edge from node1 to node2 if it is possible that node1 transfers control directly to node2; i.e any code path exists where node2 is executed directly after node1. Each edge also has a type, see FlowGraphConnectionType. Virtual nodes are often used to model complex control transfers involving conversion between completion types, such as try-finally blocks.

      Regarding end points, see the documentation of Normal, Throwing, and ControlTransfer for more details.

      This method is not pure and must have side effects. It is responsible for

      1. calling createFlowGraph (or one of its variants) on all of its children (if applicable);
      2. calling connect (or one of its variants); and
      3. returning the set of normal and throwing end points of the node.

      This method must return the set of all nodes (including the children, grand-children etc. of this node) that represent the normal and throwing end points when the node is executed. These throwing end points are used for connecting this node to other siblings and parents. See the documentation of the subclasses of FlowGraphEndPoint for more details.

      Specified by:
      createFlowGraph in interface IWorkflowNodeFlowAnalyzer<TData>
      Type Parameters:
      TElement - The type of the node elements on which the analysis is performed. This type may be different depending on whether the analysis is performed on the backend data model WorkflowNode or the frontend view model.
      Parameters:
      params - The node to analyze and the current analysis context.
      Returns:
      The set of all end points of the given node. Use ICreateFlowGraphContext#endPoints and its variants to create this return value. See the documentation of getNormalEndPoints and getThrowingEndPoints for more details.
      Throws:
      WorkflowAnalysisException - May be thrown when an unhandled exception occurred during the analysis. If this exception is thrown, the entire analysis is cancelled and the exception is propagated up. You should only throw this exception yourself if encountering an illegal state that would render the analysis invalid.
    • getBodyChildIndex

      int getBodyChildIndex()
      Returns:
      Index of the child representing the block ("try").
    • getFinalizerChildIndex

      int getFinalizerChildIndex()
      Returns:
      Index of the child representing the finalizer ("finally").
    • getHandlerChildIndex

      int getHandlerChildIndex()
      Returns:
      Index of the child representing the handler ("catch").