Interface Worklist<T extends WorklistItem>

Type Parameters:
T - The type of the worklist items which are managed in the worklist.
All Superinterfaces:
UserAttributeContainer
All Known Subinterfaces:
ClientWorklist, IncrementalWorklist<T>, InternalWorklist<T>
All Known Implementing Classes:
ClientWorklistWrapper, UnregisterClientWorklist

public interface Worklist<T extends WorklistItem> extends UserAttributeContainer
The common interface for server-side and client-side worklist. This is a meta-interface - typically there will be only objects of InternalWorklist or ClientWorklist. A special case is a IncrementalWorklist which is used for transferring worklist items incrementally to a client.

A user may have multiple worklists, but each worklist is assigned to exactly one user.

A worklist is identified by a system-wide unique worklist ID.

Every worklist has a revision, which is an ID of its version. The revision is incremented on the server-side during every change to the worklist. Using this revision, incremental updates are possible (c.f. WorklistUpdateManager.getWorklistUpdates(de.aristaflow.adept2.base.sessionmanagement.SessionToken, UUID, WorklistRevision, de.aristaflow.adept2.model.filter.Filter)).

There may be more than one client worklist per internal worklist. They all share the same state and therefore a client worklist has the same ID as the corresponding internal worklist. E.g. a may be logged in from different computers. The only difference between these client worklists is when and how they are updated, i.e. their WorklistUpdateConfiguration may be different.

  • Method Details

    • 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.
    • hashCode

      int hashCode()
      When overriding Object.equals(Object) one also needs to override Object.hashCode().
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this object.
    • 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.