Class WorkflowElementIndex


  • public final class WorkflowElementIndex
    extends Object
    Given a WorkflowTask or WorkflowProcess, contains various maps of WorkflowNodes for quickly accessing the nodes by a certain index.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getParent

        public WorkflowNode 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 WorkflowNode getParent​(NodeKey key)
        Parameters:
        key - A node to check.
        Returns:
        The parent of the node, or null when it is a root 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.
      • getParents

        public Iterable<WorkflowNode> 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<WorkflowNode> 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.
      • getTaskByNode

        public WorkflowTask getTaskByNode​(NodeKey nodeKey)
        Gets a task that the given node belongs to.
        Parameters:
        nodeKey - Node key of a node that belongs to the task to get.
        Returns:
        The task that the given node belongs to, or null if no such task exists, or it does not belong to any task.
      • getTaskByTrigger

        public WorkflowTrigger getTaskByTrigger​(TriggerKey triggerKey)
        Gets a task that the given trigger belongs to.
        Parameters:
        triggerKey - Trigger key of a trigger that belongs to the task to get.
        Returns:
        The task that the given trigger belongs to, or null if no such task exists, or it does not belong to any task.
      • getTaskByUuid

        public WorkflowTask getTaskByUuid​(UUID taskUuid)
        Gets a task by its UUID.
        Parameters:
        taskUuid - UUID of the task to get.
        Returns:
        The task with the given UUID, or null if no such task exists.
      • getTasks

        public List<WorkflowTask> getTasks()
        Returns:
        All tasks contained in this index.
      • getTasksByUuid

        public Map<UUID,​WorkflowTask> getTasksByUuid()
        Gets a map of tasks by their UUID.
        Returns:
        A map of tasks by their UUID.
      • 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
      • of

        public static WorkflowElementIndex of​(WorkflowProcess process,
                                              Mandant client)
        Creates a new index with all workflow element from the given process.
        Parameters:
        process - Workflow process to index.
        client - Current client that is used to retrieve plugin trigger and node handlers.
        Returns:
        A new index with all workflow element from the given process.
      • of

        public static WorkflowElementIndex of​(WorkflowTask task,
                                              Mandant client)
        Creates a new index with all workflow element from the given task.
        Parameters:
        task - Workflow task to index.
        client - Current client that is used to retrieve plugin trigger and node handlers.
        Returns:
        A new index with all workflow element from the given task.