Interface ITaskFlowAnalysis

  • All Superinterfaces:
    Serializable

    public interface ITaskFlowAnalysis
    extends Serializable
    Represents the result of analyzing a workflow task. Contains the data of the control flow analysis.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getFlowGraph

        com.google.common.graph.Graph<NodeKey> getFlowGraph()
        Returns the flow graph that indicated potential successors for each node. The flow graph is a directed graph with one edge for each node contained in the analyzed task. The graph has an edge from node1 to node2 iff is is possible that node1 transfers control directly to node2; i.e. iff there exists at least one code path where node2 immediately succeeds node1.
        Returns:
        The flow graph that was obtained from analyzing the task.
      • getPotentialPredecessorsOf

        Set<NodeKey> getPotentialPredecessorsOf​(NodeKey targetKey)
        Finds all potential predecessors of the given node, i.e. the nodes from which the given target node can be reached.
        Parameters:
        targetKey - The key of the target node to check.
        Returns:
        The keys of all nodes for which isNodePotentiallyReachable(nodeUuid, targetUuid) returns true.
      • getPotentialSuccessorsOf

        Set<NodeKey> getPotentialSuccessorsOf​(NodeKey sourceKey)
        Finds all potential successors of the given node, i.e. the nodes can be reached from the given source node.
        Parameters:
        sourceKey - The key of the source node to check.
        Returns:
        The keys of all nodes for which isNodePotentiallyReachable(sourceUuid, nodeUuid) returns true.
      • getRootEndPoints

        IFlowGraphEndPoints getRootEndPoints()
        Returns:
        The end points of the WorkflowTask.getRootNode(). Can be used, for example, to check, if all code paths have a return statement (which is the case if no normal end points exist).
      • isPotentiallyReachable

        default boolean isPotentiallyReachable​(NodeKey sourceKey,
                                               NodeKey targetKey)
        Checks whether there exists at least one code execution path with the property that the source node was executed at the point in time the target node is about to be executed.

        Effectively, this checks whether the target node is a potential successor of the source node. For example:

         action1();
         if (test) {
           action2();
         }
         else {
           action3();
         }
         action4();
         
        In the example above,
        • action1 is potentially reachable from no other action
        • action2 is potentially reachable from action1
        • action3 is potentially reachable from action1
        • action4 is potentially reachable from action1, action2, and action3
        In particular, action3 is definitely not reachable from action2.
        Parameters:
        sourceKey - Key of the source node to check.
        targetKey - Key of the target node to check.
        Returns:
        Whether any code path includes a path where the source node was executed at the point in time the target node is about to be executed.