Interface ITaskFlowAnalysis

  • All Superinterfaces:
    ITaskFlowAnalysisData, Serializable

    public interface ITaskFlowAnalysis
    extends ITaskFlowAnalysisData
    Represents the result of analyzing a workflow task. Contains the data of the control flow analysis. Given a program with a set of nodes as configured in the workflow designer, the flow analysis can answer questions such as "which nodes can precede a given node?" or "do all branches end with a return?"
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getFlowGraph

        @Deprecated
        default com.google.common.graph.Graph<NodeKey> getFlowGraph()
        Deprecated.
        Use ITaskFlowAnalysisData.getValueFlowGraph() instead. This method may be implemented in an inefficient manner and might e.g. create a new Graph instance each time it is called.
        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

        @Deprecated
        default 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.
      • getPotentialPredecessorsOf

        Set<NodeKey> getPotentialPredecessorsOf​(NodeKey targetKey,
                                                FlowGraphFilter.Backward filter)
        Finds all potential predecessors of the given node reachable via paths in the flow graph, observing the constraints imposed by the given filter.

        More precisely, given a target node n, this method finds all nodes {m} such that

        This method is equivalent to finding all nodes {m} for which isPotentiallyReachable(m, n, filter) returns true.
        Parameters:
        targetKey - The key of the target node to check.
        filter - Filter applied when traversing the flow graph for finding paths from the target to preceding edges. See FlowGraphFilters for some common filters.
        Returns:
        The keys of all nodes from which the target node can be reached via a path that starts with an edge of the given type.
        Since:
        8.0.0
      • getPotentialSuccessorsOf

        Set<NodeKey> getPotentialSuccessorsOf​(NodeKey sourceKey,
                                              FlowGraphFilter.Forward filter)
        Finds all potential successors of the given node reachable via paths in the flow graph, observing the constraints imposed by the given filter.

        More precisely, given a source node n, this method finds all nodes {m} such that

        This method is equivalent to finding all nodes {m} for which isPotentiallyReachable(n, m, filter) returns true.
        Parameters:
        sourceKey - The key of the source node to check.
        filter - Filter applied when traversing the flow graph for finding paths from the source to succeeding edges. See FlowGraphFilters for some common filters.
        Returns:
        The keys of all nodes which can be reached from the given source node via a path that starts with an edge of the given type.
        Since:
        8.0.0
      • isPotentiallyReachable

        @Deprecated
        default boolean isPotentiallyReachable​(NodeKey sourceKey,
                                               NodeKey targetKey)
        Checks whether the target node is reachable from the source ode via a path in the flow graph.

        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.
      • isPotentiallyReachable

        default boolean isPotentiallyReachable​(NodeKey sourceKey,
                                               NodeKey targetKey,
                                               FlowGraphFilter.Generic filter)
        Checks whether the target node is reachable from the source ode via a path in the flow graph, observing the constraints imposed by the given filter.

        More precisely, given a source node n and a target node m, this checks whether a path (n, i1, i2, i3, ..., ik, m) consisting of edges from the flow graph exists that connects node n to m, such that:

        Parameters:
        sourceKey - Key of the source node to check.
        targetKey - Key of the target node to check.
        filter - Filter applied when traversing the flow graph for finding paths from the source to the target. See FlowGraphFilters for some common filters.
        Returns:
        Whether any code path includes a path where the source node finished with the given type, and where the source node was executed at the point in time when the target node is about to be executed.
        Since:
        8.0.0