Interface Worklist<T extends WorklistItem>

    • Method Detail

      • getID

        UUID getID()
        The system-wide unique ID of this worklist. This ID is not necessarily persistent and may change between logons.
        Returns:
        The ID of the worklist.
      • getAgent

        QualifiedAgent getAgent()
        The agent this worklist belongs to.
        Returns:
        The agent this worklist belongs to.
      • getRevision

        WorklistRevision getRevision()
        Returns the current revision of this worklist, which is the update count and the service start timestamp. The update count is increased after every worklist change.
        Returns:
        The current revision of this worklist (update count and service start timestamp).
      • getWorklistItem

        T getWorklistItem​(UUID itemID)
        Gets the worklist item having the designated ID or null in case this worklist does not have an item with the designated item ID.
        Parameters:
        itemID - The ID for which to retrieve a worklist item. This must not be null.
        Returns:
        The worklist item with the designated ID or null in case this worklist does not have an item with the designated item ID.
      • getGroupingWorklistItem

        T getGroupingWorklistItem​(UUID groupId)
        Gets the grouping worklist item representing the designated group. If the designated group does not exist, null will be returned.
        Parameters:
        groupId - The ID of the item group.
        Returns:
        The worklist item that represents the designated group represents or null if the designated group does not exist.
      • getWorklistItems

        List<T> getWorklistItems()
        Returns all worklist items of this worklist. This respects aggregation of item groups, that is, either grouping items are in the list (when aggregating) or group items (when not aggregating). The list will never contain grouping and group items.

        While the internal worklist will return an unmodifiable view on the list of worklist items, the client worklist will return a copy (i.e. a snapshot) of the list which therefore does not necessarily reflect the worklist's current state (or only for a short time). This is necessary to prevent conflicts with asynchronous updates to the client worklist, e.g. while iterating over the returned list.
        TODO: Examine if it is feasible that the internal worklist only returns an unmodifiable view. Maybe it has to be a copy, too. Maybe offer both.

        Returns:
        The list of worklist items.
      • getWorklistItemGroup

        List<T> getWorklistItemGroup​(UUID groupId)
        Gets the worklist items that the designated group represents. If the designated group does not exist, null will be returned.
        Parameters:
        groupId - The ID of the item group.
        Returns:
        The worklist items that the designated group represents or null if the designated group does not exist.
      • getAggregateGroups

        boolean getAggregateGroups()
        Gets whether this worklist aggregates all worklist groups and returns only the grouping items instead of the actual (flat) worklist items in getWorklistItems().
        Returns:
        Whether this worklist aggregates all worklist groups and returns only the grouping items instead of the actual (flat) worklist items in getWorklistItems().
      • setAggregateGroups

        void setAggregateGroups​(boolean aggregate)
        Sets whether this worklist aggregates all worklist groups and returns only the grouping items instead of the actual (flat) worklist items in getWorklistItems(). Note that changing this may require some time since the implementation needs to restructure the items.
        Parameters:
        aggregate - Whether this worklist aggregates all worklist groups and returns only the grouping items instead of the actual (flat) worklist items in getWorklistItems().
      • getWorklistItemsFlat

        List<T> getWorklistItemsFlat​(boolean includeGroupingItems)
        Gets all worklist items of this worklist, this includes items within groups and optionally the grouping items representing the groups. This differs from getWorklistItems() in that this method ignores aggregation and returns the items flat independent from whether this worklist aggregates or not. When excluding grouping items, the returned result is equal to getWorklistItems() when not aggregating.
        Parameters:
        includeGroupingItems - Whether to include the grouping items, that are, the worklist items that are only for grouping purpose.
        Returns:
        The list of all items in this worklist optionally including or excluding grouping items.
      • equals

        boolean equals​(Object obj)
        Two worklists are equal if they're either both internal worklists or client worklists and additionally their IDs are equal.

        Object.hashCode() must be implemented accordingly.

        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • equals

        static boolean equals​(Worklist<?> me,
                              Object obj)
        Implements equality on Worklists. This is both objects implement Worklists and have the same ID.
        Parameters:
        me - The object on which to call equals(Object).
        obj - The object with which to compare the current/other object.
        Returns:
        Whether the designated objects are equal, that is, both implement Worklist and have the same ID.