Interface ITaskFlowAnalysisData

  • All Superinterfaces:
    Serializable
    All Known Subinterfaces:
    ITaskFlowAnalysis

    public interface ITaskFlowAnalysisData
    extends Serializable
    Base data with the result of analyzing a workflow task, without analysis operations. Contains the end points, the hierarchy graph, and the created flow graph.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • associate

        <K,​V> V associate​(K key,
                                Function<K,​V> computeValue)
        Associates and returns a value with a given key. Both the key and the value should be Serializable. The value is bound to the lifetime of this flow analysis. Ensures that the value is computed only once and reused during subsequent calls with the same key to this method.
        Type Parameters:
        K - Type of the key with which to associate a value.
        V - Type of the value to associate with the key.
        Parameters:
        key - Key with which to associate a value. Must be Serializable and must implement Object.equals(Object) and Object.hashCode() in an appropriate manner.
        computeValue - Computes the value for a given key, when no value was yet associated with a key.
        Returns:
        The value for the given key.
      • getEndPoints

        IFlowGraphEndPoints getEndPoints​(NodeKey node)
        The end points of the given node. Can be used, for example, to check, if all code paths have a return statement or end abruptly. (which is the case if no normal end points exist). See the sub classes of FlowGraphEndPoint for more details regarding end points.
        Parameters:
        node - Node for which to find the end points.
        Returns:
        The end points of the given node. Never null, but might be empty if a non-existing node was given.
      • getHierarchyGraph

        com.google.common.graph.Graph<NodeKey> getHierarchyGraph()
        Returns a directed graph with all nodes and an edge from the parent to the child.

        Note: IVirtualFlowGraphNode are not present in the hierarchy graph, as they are not part of the syntax tree.

        Returns:
        A graph representing the hierarchy of the nodes.
      • getRootEndPoints

        IFlowGraphEndPoints getRootEndPoints()
        The end points of the root node. Can be used, for example, to check, if all code paths have a return statement or end abruptly. (which is the case if no normal end points exist). See the sub classes of FlowGraphEndPoint for more details regarding end points.
        Returns:
        The end points of the root node.
      • getValueFlowGraph

        com.google.common.graph.ValueGraph<NodeKey,​? extends IFlowGraphEdgeData> getValueFlowGraph()
        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.

        In addition, each edge has additional data with information about that edge, see IFlowGraphEdgeData.

        Returns:
        The flow graph that was obtained from analyzing the task.
        Since:
        8.0.0
      • getVirtualNodes

        com.google.common.collect.ImmutableMap<NodeKey,​IVirtualFlowGraphNode> getVirtualNodes()
        An index with all virtual flow graph nodes that were introduced into the graph.
        Returns:
        A map with all virtual nodes, indexed by their node key.
        Since:
        8.1.0
      • isRealNode

        default boolean isRealNode​(NodeKey nodeKey)
        Checks whether the given node is a real WorkflowNode, see IVirtualFlowGraphNode and getVirtualNodes() for more details.
        Parameters:
        nodeKey - Key of a node to check
        Returns:
        Whether the given key refers to a real node.
        Since:
        8.1.0
      • isVirtualNode

        default boolean isVirtualNode​(INodeKeyProviding nodeKey)
        Checks whether the given node is a virtual node, see IVirtualFlowGraphNode and getVirtualNodes() for more details.
        Parameters:
        nodeKey - Key of a node to check
        Returns:
        Whether the given key refers to a virtual node.
        Since:
        8.1.0
      • isVirtualNode

        default boolean isVirtualNode​(NodeKey nodeKey)
        Checks whether the given node is a virtual node, see IVirtualFlowGraphNode and getVirtualNodes() for more details.
        Parameters:
        nodeKey - Key of a node to check
        Returns:
        Whether the given key refers to a virtual node.
        Since:
        8.1.0
      • resolveToRealNode

        NodeKey resolveToRealNode​(NodeKey nodeKey)
        Resolves a node key to a real WorkflowNode in the flow graph. A flow graph may contain real nodes and virtual nodes. If the given node key points to a real node, that node is returned. If it points to a virtual node, the virtual node's owner is returned. If it points to non-existing node, the given node key is simply returned as-is.
        Parameters:
        nodeKey - Node key to resolve.
        Returns:
        A node key pointing to a real node.
        Since:
        8.1.0