Interface ICreateFlowGraphContext<TElement extends IWorkflowNodeTypeProviding>

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

    public interface ICreateFlowGraphContext<TElement extends IWorkflowNodeTypeProviding>
    Context provided to the node handlers during a call to createFlowGraph. Handlers may use this context to recursively analyze their children as well.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • childCount

        int childCount​(TElement node)
        Parameters:
        node - Node to check.
        Returns:
        Number of children the given node contains.
      • connect

        void connect​(com.google.common.collect.ImmutableSet<NodeKey> from,
                     NodeKey to)
        For each source in from, adds an edge (source, to) to the flow graph.
        Parameters:
        from - Source node.
        to - Target node.
      • connect

        void connect​(com.google.common.collect.ImmutableSet<NodeKey> from,
                     TElement toParent,
                     int toChildIndex)
        Finds the child at the given index in the toParent and adds an edge (from, child) to the flow graph.
        Parameters:
        from - Source node.
        toParent - Parent with the target node.
        toChildIndex - Index of the target node in the parent node.
      • connect

        void connect​(NodeKey from,
                     NodeKey to)
        Adds an edge (from, to) to the flow graph.
        Parameters:
        from - Source node.
        to - Target node.
      • connect

        void connect​(TElement from,
                     TElement to)
        Adds an edge (from, to) to the flow graph.
        Parameters:
        from - Source node.
        to - Target node.
      • connectParentToChild

        void connectParentToChild​(TElement parent,
                                  int childIndex)
        Finds the child at the given index in the toParent and adds an edge (parent, child) to the flow graph.
        Parameters:
        parent -
        childIndex -
      • createFlowGraphForChild

        IFlowGraphEndPoints createFlowGraphForChild​(TElement parent,
                                                    int childIndex)
                                             throws WorkflowAnalysisException
        Creates the flow graph for the given node and return its end points.
        Parameters:
        parent - Parent node with a child to analyze.
        childIndex - Index of the child to analyze.
        Returns:
        The end points of the given node.
        Throws:
        WorkflowAnalysisException - When the analysis could not be completed, usually because a child threw an exception.
      • createNodeKey

        NodeKey createNodeKey​(TElement element)
        Creates the element key that needs to be entered in the list of potentially reachable nodes.
        Parameters:
        element - Element for which to create the key.
        Returns:
        The key of the element.
      • endPointsAlwaysReturning

        IFlowGraphEndPoints endPointsAlwaysReturning()
        Returns:
        A new POJO with no normal and no throwing end points.
      • isHasChild

        boolean isHasChild​(TElement node,
                           int childIndex)
        Parameters:
        node - Node to check.
        childIndex - Index to check.
        Returns:
        true when the node has a child at the given index, false otherwise.
      • union

        com.google.common.collect.ImmutableSet<NodeKey> union​(com.google.common.collect.ImmutableSet<NodeKey>... sets)
        Helper method that computes the union of all given sets.
        Parameters:
        sets - More sets to unite.
        Returns:
        A set representing the union of all input sets.
      • union

        com.google.common.collect.ImmutableSet<NodeKey> union​(Iterable<com.google.common.collect.ImmutableSet<NodeKey>> sets)
        Helper method that computes the union of all given sets.
        Parameters:
        sets - More sets to unite.
        Returns:
        A set representing the union of all input sets.
      • union

        com.google.common.collect.ImmutableSet<NodeKey> union​(com.google.common.collect.ImmutableSet<NodeKey> set1,
                                                              com.google.common.collect.ImmutableSet<NodeKey> set2)
        Helper method that computes the union of all given sets.
        Parameters:
        set1 - One set to combined.
        set2 - Another set to combined.
        Returns:
        A set representing the union of all input sets.