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 ofInternalWorklist
orClientWorklist
. A special case is aIncrementalWorklist
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 Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static boolean
equals(Worklist<?> me, Object obj)
Implements equality onWorklist
s.boolean
equals(Object obj)
Two worklists are equal if they're either both internal worklists or client worklists and additionally their IDs are equal.QualifiedAgent
getAgent()
The agent this worklist belongs to.boolean
getAggregateGroups()
Gets whether this worklist aggregates all worklist groups and returns only the grouping items instead of the actual (flat) worklist items ingetWorklistItems()
.T
getGroupingWorklistItem(UUID groupId)
Gets the grouping worklist item representing the designated group.UUID
getID()
The system-wide unique ID of this worklist.WorklistRevision
getRevision()
Returns the current revision of this worklist, which is the update count and the service start timestamp.T
getWorklistItem(UUID itemID)
Gets the worklist item having the designated ID ornull
in case this worklist does not have an item with the designated item ID.List<T>
getWorklistItemGroup(UUID groupId)
Gets the worklist items that the designated group represents.List<T>
getWorklistItems()
Returns all worklist items of this worklist.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.int
hashCode()
When overridingObject.equals(Object)
one also needs to overrideObject.hashCode()
.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 ingetWorklistItems()
.-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
-
-
-
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 ornull
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 benull
.- 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 ingetWorklistItems()
.- 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 ingetWorklistItems()
. 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 ingetWorklistItems()
.
-
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 fromgetWorklistItems()
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 togetWorklistItems()
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.
-
hashCode
int hashCode()
When overridingObject.equals(Object)
one also needs to overrideObject.hashCode()
.
-
equals
static boolean equals(Worklist<?> me, Object obj)
- Parameters:
me
- The object on which to callequals(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.
-
-