Class AssociateHelper


  • public final class AssociateHelper
    extends Object
    Contains all methods that associate derived quantities with the current state.

    By providing the proper dependencies, the derived quantities are recomputed only when that dependency has changed. For example, we only need to recompute the flow analysis when the structure of the node has changed, e.g. when a node was added or moved.

    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getAllTasks

        public static List<ITaskWithName> getAllTasks​(AssociatesModel ass,
                                                      FlowchartModel model,
                                                      UUID taskToExclude)
        Parameters:
        ass - Associate model for associating values.
        model - Flowchart model to use.
        taskToExclude - UUID of a task to exclude in the result. May be null when no task should be excluded.
        Returns:
        All tasks in the flowchart, without the task to exclude if given.
      • getAllTriggersOfType

        public static List<ITriggerWithName> getAllTriggersOfType​(AssociatesModel ass,
                                                                  FlowchartModel model,
                                                                  Mandant client,
                                                                  String type,
                                                                  UUID taskToExclude)
        Parameters:
        ass - Associate model for associating values.
        model - Flowchart model to use.
        client - Current client, used to find trigger handlers.
        type - Type of the triggers to find. Can be null or empty to include all triggers.
        taskToExclude - UUID of a task to exclude in the result. May be null when no task should be excluded.
        Returns:
        All triggers in the flowchart that are of the given IWorkflowElementTypeProviding.getType().
      • getAttachmentProvidingParents

        public static List<INodeWithName> getAttachmentProvidingParents​(AssociatesModel ass,
                                                                        FlowchartModel model,
                                                                        Mandant client,
                                                                        NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find its parents.
        Returns:
        A list of all nodes that are a parent of the given node and can provide attachments to that node. The given node itself is not included.
      • getDeadNodesDiff

        public static ValueDiff<Set<NodeKey>> getDeadNodesDiff​(AssociatesModel ass,
                                                               FlowchartModel model,
                                                               Mandant client)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client.
        Returns:
        The set of nodes that are considered dead code.
      • getElementIndex

        public static FlowchartElementIndex getElementIndex​(AssociatesModel ass,
                                                            FlowchartModel model)
        Parameters:
        ass - Associate model for associating values.
        model - Flowchart model.
        Returns:
        The element index with map from UUIDs etc. to the element.
      • getErrorCompletionPredecessors

        public static List<INodeWithName> getErrorCompletionPredecessors​(AssociatesModel ass,
                                                                         FlowchartModel model,
                                                                         Mandant client,
                                                                         NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find predecessors.
        Returns:
        A list of all nodes from which the given targetNode is reachable in the control flow graph (see isPotentiallyReachable) via throwing initial edges.
        Since:
        8.0.0
      • getFileProvidingParents

        public static List<IFileProvidingNodeWithName> getFileProvidingParents​(AssociatesModel ass,
                                                                               FlowchartModel model,
                                                                               Mandant client,
                                                                               NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find its parents.
        Returns:
        A list of all nodes that are a parent of the given node and can provide files to that node. The given node itself is not included.
      • getFlowAnalysis

        public static WorkflowFlowAnalysis getFlowAnalysis​(AssociatesModel ass,
                                                           FlowchartModel model,
                                                           Mandant client)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client.
        Returns:
        The execution analysis for the current flowchart model.
      • getNormalCompletionAttachmentProvidingPredecessors

        public static List<INodeWithName> getNormalCompletionAttachmentProvidingPredecessors​(AssociatesModel ass,
                                                                                             FlowchartModel model,
                                                                                             Mandant client,
                                                                                             NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find providing predecessors.
        Returns:
        A list of all nodes that produce attachments when executed (see getAttachmentValueDescriptor) and from which the given targetNode is reachable in the control flow graph (see isPotentiallyReachable).
        Since:
        8.1.0
      • getNormalCompletionPredecessors

        public static List<INodeWithName> getNormalCompletionPredecessors​(AssociatesModel ass,
                                                                          FlowchartModel model,
                                                                          Mandant client,
                                                                          NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find predecessors.
        Returns:
        A list of all nodes from which the given targetNode is reachable in the control flow graph (see isPotentiallyReachable) via normal initial edges.
        Since:
        8.0.0
      • getNormalCompletionProvidingPredecessors

        public static List<IFileProvidingNodeWithName> getNormalCompletionProvidingPredecessors​(AssociatesModel ass,
                                                                                                FlowchartModel model,
                                                                                                Mandant client,
                                                                                                NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find providing predecessors.
        Returns:
        A list of all nodes that produce files when executed (see getFileValueDescriptor) and from which the given targetNode is reachable in the control flow graph (see isPotentiallyReachable) via normal initial edges.
        Since:
        8.0.0
      • getParentControlTransferTargets

        public static List<INodeWithName> getParentControlTransferTargets​(AssociatesModel ass,
                                                                          FlowchartModel model,
                                                                          Mandant client,
                                                                          NodeKey targetNode,
                                                                          String[] targetTypes)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find its parents.
        targetTypes - Control flow types. When none are given, all nodes that support at least one control transfer type are included.
        Returns:
        A list of all nodes that are a parent of the given node and also support at least one of the given control flow types. The given node itself is not included.
      • getParents

        public static List<INodeWithName> getParents​(AssociatesModel ass,
                                                     FlowchartModel model,
                                                     Mandant client,
                                                     NodeKey targetNode)
        Parameters:
        ass - Associate model for associating values.
        model - Current flowchart model.
        client - Current client, used to find node handlers.
        targetNode - Target node for which to find its parents.
        Returns:
        A list of all nodes that are a parent of the given node. The given node itself is not included.