Class AssociateHelper

java.lang.Object
de.xima.fc.workflow.designer.helper.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 Details

    • getAllNodesOfType

      public static List<INodeWithName> getAllNodesOfType(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, String type)
      Parameters:
      ass - Associate model for associating values.
      model - Flowchart model to use.
      client - Current client, used to find node handlers.
      project - Current project.
      type - Type of the nodes to find.
      Returns:
      All nodes in the flowchart that are of the given IWorkflowElementTypeProviding.getType().
    • 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().
    • getAssignedProvidingTriggers

      public static List<IFileProvidingTriggerWithName> getAssignedProvidingTriggers(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, NodeKey targetNode)
    • getAssignedTriggers

      public static List<ITriggerWithName> getAssignedTriggers(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, NodeKey targetNode)
    • getAttachmentProvidingParents

      public static List<INodeWithName> getAttachmentProvidingParents(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode, String[] targetTypes)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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.
    • getPredecessors

      @Deprecated public static List<INodeWithName> getPredecessors(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project.
      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

      @Deprecated public static List<IFileProvidingNodeWithName> getProvidingPredecessors(AssociatesModel ass, FlowchartModel model, Mandant client, Projekt project, NodeKey targetNode)
      Parameters:
      ass - Associate model for associating values.
      model - Current flowchart model.
      client - Current client, used to find node handlers.
      project - Current project scope.
      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).