Class FlowchartElementIndex

  • All Implemented Interfaces:
    Serializable

    public final class FlowchartElementIndex
    extends Object
    implements Serializable
    An index of the nodes and triggers in a workflow process.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • FlowchartElementIndex

        public FlowchartElementIndex​(ProcessModel processModel)
        Creates a new index for the given process.
        Parameters:
        processModel - Process model to index.
    • Method Detail

      • getNodeByUuid

        public Map<NodeKey,​NodeModel> getNodeByUuid()
        Returns:
        Map with all nodes, indexed by node key.
      • getNodeByUuid

        public NodeModel getNodeByUuid​(ElementKey key)
        Parameters:
        key - Key of the node to fetch.
        Returns:
        The node with the given key in the process model. null when no such node exists.
      • getNodeByUuid

        public NodeModel getNodeByUuid​(NodeKey key)
        Parameters:
        key - Key of the node to fetch.
        Returns:
        The node with the given key in the process model. null when no such node exists.
      • getNodeByUuid

        public NodeModel getNodeByUuid​(UUID taskUuid,
                                       UUID nodeUuid)
        Parameters:
        taskUuid - UUID of the task of the node to fetch.
        nodeUuid - UUID of the node to fetch.
        Returns:
        The node with the given UUID in the process model. null when no such node exists.
      • getNodeParentMap

        public Map<NodeKey,​NodeKey> getNodeParentMap()
        Gets the map from a node to the parent of that node.
        Returns:
        The map from a node to the parent of that node.
      • getNodes

        public Set<NodeKey> getNodes()
        Returns:
        Keys of all available nodes.
      • getNodesByType

        public List<NodeKey> getNodesByType​(String type)
        Gets all nodes of a certain type.
        Parameters:
        type - Target type to look for.
        Returns:
        All nodes of the given type.
      • getParent

        public NodeModel getParent​(ElementKey key)
        Parameters:
        key - A node to check.
        Returns:
        The parent of the node, or null when it is a root node.
      • getParent

        public NodeModel getParent​(NodeKey key)
        Parameters:
        key - A node to check.
        Returns:
        The parent of the node, or null when it is a root node.
      • getParents

        public Iterable<NodeModel> getParents​(ElementKey start,
                                              boolean includeStartNode)
        Parameters:
        start - Start node.
        includeStartNode - Whether to include the start node in the iterable.
        Returns:
        An iterable over all parents of the start node.
      • getParents

        public Iterable<NodeModel> getParents​(NodeKey start,
                                              boolean includeStartNode)
        Parameters:
        start - Start node.
        includeStartNode - Whether to include the start node in the iterable.
        Returns:
        An iterable over all parents of the start node.
      • getParentUuids

        public Iterable<NodeKey> getParentUuids​(ElementKey start,
                                                boolean includeStartNode)
        Parameters:
        start - Start node.
        includeStartNode - Whether to include the start node in the iterable.
        Returns:
        An iterable over all parents of the start node.
      • getParentUuids

        public Iterable<NodeKey> getParentUuids​(NodeKey start,
                                                boolean includeStartNode)
        Parameters:
        start - Start node.
        includeStartNode - Whether to include the start node in the iterable.
        Returns:
        An iterable over all parents of the start node.
      • getTaskByUuid

        @Nullable
        public TaskModel getTaskByUuid​(UUID uuid)
        Gets a task by its UUID.
        Parameters:
        uuid - UUID of the task to search for.
        Returns:
        The task with the given UUID, null if no such task exists.
      • getTasks

        public Collection<TaskModel> getTasks()
        Gets all available tasks.
        Returns:
        All available tasks.
      • getTasksByUuid

        public Map<UUID,​TaskModel> getTasksByUuid()
        Gets the mapping from the UIUD of a task to that task.
        Returns:
        The mapping from the UIUD of a task to that task.
      • getTriggerByUuid

        public Map<TriggerKey,​TriggerModel> getTriggerByUuid()
        Returns:
        Map with all triggers, indexed by trigger key.
      • getTriggerByUuid

        public TriggerModel getTriggerByUuid​(ElementKey key)
        Parameters:
        key - Key of the trigger to fetch.
        Returns:
        The trigger with the given key in the process model. null when no such trigger exists.
      • getTriggerByUuid

        public TriggerModel getTriggerByUuid​(TriggerKey key)
        Parameters:
        key - Key of the trigger to fetch.
        Returns:
        The trigger with the given key in the process model. null when no such trigger exists.
      • getTriggerByUuid

        public TriggerModel getTriggerByUuid​(UUID taskUuid,
                                             UUID triggerUuid)
        Parameters:
        taskUuid - UUID of the task of the trigger to fetch.
        triggerUuid - UUID of the trigger to fetch.
        Returns:
        The trigger with the given UUID in the process model. null when no such trigger exists.
      • getTriggers

        public Set<TriggerKey> getTriggers()
        Returns:
        Keys of all available triggers.
      • getTriggersByType

        public List<TriggerKey> getTriggersByType​(String type)
        Gets all triggers of a certain type.
        Parameters:
        type - Trigger type to search for.
        Returns:
        A list with all triggers of the given type.
      • isParent

        public boolean isParent​(NodeKey parent,
                                NodeKey child)
        Checks if a node is a parent of another node.
        Parameters:
        parent - Potential parent.
        child - Potential child.
        Returns:
        true if the given parent is truly a parent of the given child, or if parent == child.
        Since:
        8.1.0