Interface InternalWorklist<T extends InternalWorklistItem>
-
- Type Parameters:
T
- theInternalWorklist
only holdsInternalWorklistItem
s and subtypes thereof.
- All Superinterfaces:
UserAttributeContainer
,Worklist<T>
public interface InternalWorklist<T extends InternalWorklistItem> extends Worklist<T>
The internal, server-side representation of a worklist. For each pair of agent ID und orgPosition ID there's only oneInternalWorklist
, but there may be an indefinite number of associatedclient-side representations
.It offers methods to manipulate the list (i.e. add, change and remove items) and manage references to client worklists that were registered for push updates. Changes to the items of this list are recorded and can be retrieved through
getUpdates(long, Filter)
. The references to client worklists are only managed; none of their methods are called by the internal worklist.See
Worklist
for more information about the relationship betweenInternalWorklist
andClientWorklist
.- Author:
- Kevin Goeser, Ulrich Kreher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addUpdateableClientWorklist(ClientWorklist clientWorklist)
Adds the given client worklist as recipient for push updates.boolean
addWorklistItem(T item)
Adds a worklist item (subtype of
) to this worklist.InternalWorklistItem
long
getAbsenceFromDate()
Gets the date (as long) from which on the agent of this internal worklist is absent. 0 means the agent is already / with immediate effect absent, a negative number indicates that the absence is not set, that is, the agent is present.long
getAbsenceToDate()
Gets the date (as long) until the agent of this internal worklist is absent. 0 means the agent is absent indefinitely, a negative number indicates that the absence is not set, that is, the agent is present.long
getNextClientWorklistId()
Gets the next ID for the client worklist of this internal worklist.long
getNextClientWorklistId(boolean inc)
Gets the next ID for the client worklist of this internal worklist only optionally increasing the internal count.String
getSubstitutionRule()
If absence information is set for this worklist, this method will return either a valid substitution rule ornull
for an absence without substitution.Map<Long,ClientWorklist>
getUpdateableClientWorklists()
Returns all client worklists that are registered as recipient for push updates.WorklistUpdate
getUpdates(long sinceRevision, Filter worklistFilter)
Returns all updates since the given revision of this worklist.boolean
isPresentNow()
Returns whether the owning agent of this worklist is present at this moment, based on thecurrent time
and theprovided absence information
.void
removeUpdateableClientWorklist(long clientWorklistID)
Removes the given client worklist as recipient for push updatesvoid
removeUpdateableClientWorklist(ClientWorklist clientWorklist)
Removes the given client worklist as recipient for push updatesvoid
removeWorklistItem(T item)
Removes a worklist item (subtype of
) that is no longer in this worklist.InternalWorklistItem
void
setAbsent(long from, long to, String substitutionRule)
Sets the absence of the agent of this internal worklist for the designated time.void
setPresent()
Disables the absence of the agent of this internal worklist.void
updateIndividualSettings(ClientWorklistItem clientWorklistItem)
Updates the individual item settings by taking them from the given client worklist item.void
updateWorklistItem(T item)
Updates a worklist item (subtype of
) already managed by this worklist.InternalWorklistItem
-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
Methods inherited from interface de.aristaflow.adept2.model.worklistmodel.Worklist
equals, getAgent, getAggregateGroups, getGroupingWorklistItem, getID, getRevision, getWorklistItem, getWorklistItemGroup, getWorklistItems, getWorklistItemsFlat, hashCode, setAggregateGroups
-
-
-
-
Method Detail
-
addWorklistItem
boolean addWorklistItem(T item)
Adds a worklist item (subtype of
) to this worklist. The revision will be increased byInternalWorklistItem
1
and the change will be recorded in order to make it available throughgetUpdates(long, Filter)
.Make sure to add grouping worklist items before items of the corresponding group.
Note to implementors:
If this worklist already contains the given item, the item should be updated instead and this incident be properly logged, so it doesn't go unnoticed.- Parameters:
item
- The worklist item to add.- Returns:
- Whether the worklist item has been really added to this worklist. It will not be added (again) if it is already on this worklist.
-
updateWorklistItem
void updateWorklistItem(T item)
Updates a worklist item (subtype of
) already managed by this worklist. The revision will be increased byInternalWorklistItem
1
and the change will be recorded in order to make it available throughgetUpdates(long, Filter)
.Note to implementors:
If this worklist doesn't contain the given item, the item should be added instead and this incident be properly logged, so it doesn't go unnoticed.- Parameters:
item
- The worklist item to update.
-
removeWorklistItem
void removeWorklistItem(T item)
Removes a worklist item (subtype of
) that is no longer in this worklist. The revision will be increased byInternalWorklistItem
1
and the change will be recorded in order to make it available throughgetUpdates(long, Filter)
.Make sure to remove grouping worklist items after items of the corresponding group.
Note to implementors:
If this worklist doesn't contain the given item, it should be ignored and this incident be properly logged, so it doesn't go unnoticed.- Parameters:
item
- The worklist item to remove.
-
updateIndividualSettings
void updateIndividualSettings(ClientWorklistItem clientWorklistItem)
Updates the individual item settings by taking them from the given client worklist item.- Parameters:
clientWorklistItem
- the client worklist item to read the individual settings from
-
getNextClientWorklistId
long getNextClientWorklistId()
Gets the next ID for the client worklist of this internal worklist.- Returns:
- The next ID for the client worklist of this internal worklist.
-
getNextClientWorklistId
long getNextClientWorklistId(boolean inc)
Gets the next ID for the client worklist of this internal worklist only optionally increasing the internal count. Only use this for storing the internal worklist but not for creating new client worklists!- Parameters:
inc
- Whether to increase the internal count for client worklist IDs.- Returns:
- The next ID for the client worklist of this internal worklist.
-
addUpdateableClientWorklist
void addUpdateableClientWorklist(ClientWorklist clientWorklist)
Adds the given client worklist as recipient for push updates.- Parameters:
clientWorklist
- The client worklist as recipient for push updates.
-
removeUpdateableClientWorklist
void removeUpdateableClientWorklist(ClientWorklist clientWorklist)
Removes the given client worklist as recipient for push updates- Parameters:
clientWorklist
- The client worklist to be removed.
-
removeUpdateableClientWorklist
void removeUpdateableClientWorklist(long clientWorklistID)
Removes the given client worklist as recipient for push updates- Parameters:
clientWorklistID
- The client worklist to be removed.
-
getUpdateableClientWorklists
Map<Long,ClientWorklist> getUpdateableClientWorklists()
Returns all client worklists that are registered as recipient for push updates.- Returns:
- All client worklists that are registered as recipient for push updates.
-
getUpdates
WorklistUpdate getUpdates(long sinceRevision, Filter worklistFilter)
Returns all updates since the given revision of this worklist.
If no updates have been made (i.e. the given revision equals thisworklist's current revision (update count)
) an emptyWorklistUpdate
-instance is returned.
If the "since" revision is no longer available, aWorklistUpdate
with the source revision0
is returned, containing all worklist items with theWorklistItemUpdateState
WorklistConstants.WorklistItemUpdateType.ADDED
.See
WorklistUpdate.getAll()
for more information on how to determine the contents of a worklist update.Whether the returned update also reflects changes while executing this method is determined by the implementation. In any case the update may never contain any inconsistent data, like incomplete revisions.
Optionally a filter on the worklist items may be specified. If the revision is greater than 0, this filter must be the same that has been used to retrieve previous updates. Otherwise this might result in an inconsistent state of
ClientWorklist
s.- Parameters:
sinceRevision
- The revision from which all updates until the current revision are to be retrieved.worklistFilter
- the filter used on the worklist items; may be {code null}; if the revision is greater than 0, this filter must be the same that has been used to retrieve previous updates; otherwise this might result in the inconsistent state ofClientWorklist
s- Returns:
- A
WorklistUpdate
containing all update information since the designated revision or a full update with source revision0
in case that information is no longer available. - See Also:
ClientWorklist.updateWorklist(WorklistUpdate)
-
getSubstitutionRule
String getSubstitutionRule()
If absence information is set for this worklist, this method will return either a valid substitution rule ornull
for an absence without substitution. The empty string will be returned if no absence is set. Do not use this property to determine whether the agent is currently present. UseisPresentNow()
instead.- Returns:
- A valid substitution rule if absence information is set,
null
if absence is set without substitution and an empty string otherwise if no absence is set. - See Also:
setAbsent(long, long, String)
-
setAbsent
void setAbsent(long from, long to, String substitutionRule)
Sets the absence of the agent of this internal worklist for the designated time. If a worklist item is to be added to worklists which are all absent, the corresponding substitution rules apply and add the item accordingly. Usenull
for the rule indicates no substitutes. This is useful for longterm absence.- Parameters:
from
- The absolutedate
from which on the agent is absent. 0 means from now on.to
- The absolutedate
until the agent is absent. 0 means the end date is not known and it will last untilsetPresent()
.substitutionRule
- The rule which qualifies the substituting agents. If this isnull
or the empty string, the agent will not have a substitute for this absence.
-
getAbsenceFromDate
long getAbsenceFromDate()
Gets the date (as long) from which on the agent of this internal worklist is absent. 0 means the agent is already / with immediate effect absent, a negative number indicates that the absence is not set, that is, the agent is present. To determine whether the agent is currently present callisPresentNow()
.- Returns:
- The date as long from which the agent of this internal worklist is absent, 0 for "already absent", a negative number for a present agent.
-
getAbsenceToDate
long getAbsenceToDate()
Gets the date (as long) until the agent of this internal worklist is absent. 0 means the agent is absent indefinitely, a negative number indicates that the absence is not set, that is, the agent is present. To determine whether the agent is currently present callisPresentNow()
.- Returns:
- The date as long until the agent of this internal worklist is absent, 0 for indefinitely, a negative number for a present agent.
-
setPresent
void setPresent()
Disables the absence of the agent of this internal worklist.
-
isPresentNow
boolean isPresentNow()
Returns whether the owning agent of this worklist is present at this moment, based on thecurrent time
and theprovided absence information
.- Returns:
- whether the owning agent of this worklist is present at this moment
-
-