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().
      • 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.
      • 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.
      • getPredecessors

        public static List<INodeWithName> getPredecessors​(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).
      • getProvidingPredecessors

        public static List<INodeWithName> getProvidingPredecessors​(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).