public class AssuringWorklistUpdate extends de.aristaflow.adept2.model.common.defaultimplementation.SerialisableUserAttributeContainer implements WorklistUpdate
WorklistUpdate, for instance
ClientWorklistListener, the soft state can be assured and a hard
state can be set using this class. WorklistConstants.WorklistItemUpdateType.ADDED_OR_CHANGED to
either WorklistConstants.WorklistItemUpdateType.ADDED or
WorklistConstants.WorklistItemUpdateType.CHANGED and
WorklistConstants.WorklistItemUpdateType.REMOVED_OR_NOTHING to either
WorklistConstants.WorklistItemUpdateType.REMOVED or complete removal of the item from
the update.| Modifier and Type | Field and Description |
|---|---|
protected long |
initialisationDate
The date of the last initialisation of the worklist.
|
protected java.util.Map<ClientWorklistItem,WorklistItemUpdate<ClientWorklistItem>> |
itemUpdates
All items of the worklist update in which the types will be set to hard if
appropriate.
|
protected int |
maxPriority
The highest priority of all items of this update.
|
protected long |
sourceRevision
The source revision of the update.
|
protected long |
targetRevision
The target revision of the update.
|
protected java.util.UUID |
worklistID
The worklist ID.
|
| Constructor and Description |
|---|
AssuringWorklistUpdate(java.util.UUID worklistID,
long initialisationDate,
int maxPriority,
long sourceRevision,
long targetRevision,
java.util.Collection<WorklistItemUpdate<ClientWorklistItem>> updates,
java.util.Map<java.lang.String,java.lang.String> userAttributes)
Creates a new wrapper for the designated worklist update allowing to
override and assure the update type of specific worklist items.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assureWorklistItemAdded(ClientWorklistItem item)
Sets the worklist update type of the designated worklist item to
WorklistConstants.WorklistItemUpdateType.ADDED. |
void |
assureWorklistItemChanged(ClientWorklistItem item)
Sets the worklist update type of the designated worklist item to
WorklistConstants.WorklistItemUpdateType.CHANGED. |
void |
assureWorklistItemRemoved(ClientWorklistItem item)
Sets the worklist update type of the designated worklist item to
WorklistConstants.WorklistItemUpdateType.REMOVED. |
void |
assureWorklistItemUnknown(ClientWorklistItem item)
Removes the designated worklist item from this worklist update.
|
java.util.Collection<WorklistItemUpdate<ClientWorklistItem>> |
getAll()
Returns all updates, i.e. the differences from the source revision up to
(and including) the target revision.
|
int |
getMaxPriority()
Returns the highest priority of this update, that is the highest priority
of all items of this update.
|
WorklistRevision |
getSourceRevision()
Gets the source revision, i.e. the worklist revision (initialisation date and update count) to
which this update can be applied.
|
long |
getTargetRevision()
Returns the target revision, i.e. the new revision (update count) the client worklist will have
after applying this update.
|
java.util.UUID |
getWorklistID()
The ID of the worklist for which this update is intended.
|
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributes, setUserAttributeValue, subEquals, subHashCodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValueprotected final java.util.Map<ClientWorklistItem,WorklistItemUpdate<ClientWorklistItem>> itemUpdates
protected final java.util.UUID worklistID
protected final long sourceRevision
protected final long targetRevision
protected final long initialisationDate
protected final int maxPriority
public AssuringWorklistUpdate(java.util.UUID worklistID,
long initialisationDate,
int maxPriority,
long sourceRevision,
long targetRevision,
java.util.Collection<WorklistItemUpdate<ClientWorklistItem>> updates,
java.util.Map<java.lang.String,java.lang.String> userAttributes)
worklistID - initialisationDate - maxPriority - sourceRevision - targetRevision - updates - The worklist item which to be wrapped and of which to
override and assure update types of specific worklist items.userAttributes - public java.util.UUID getWorklistID()
WorklistUpdategetWorklistID in interface WorklistUpdatepublic WorklistRevision getSourceRevision()
WorklistUpdatesource revision up to (and including) the
target revision (update count).getSourceRevision in interface WorklistUpdatepublic long getTargetRevision()
WorklistUpdate
The update contains all changes that have been made to the worklist since the
source revision (update count) up to (and including) the
target revision.
Like the source revision the target revision refers to the initialisation date of the worklist.
getTargetRevision in interface WorklistUpdatepublic int getMaxPriority()
WorklistUpdateWorklistConstants.Priority.NORMAL.getMaxPriority in interface WorklistUpdatepublic java.util.Collection<WorklistItemUpdate<ClientWorklistItem>> getAll()
WorklistUpdateThe returned collection is unmodifiable.
When compiling the individual recorded updates into a worklist update, the
case when there are multiple recorded updates for the same worklist item
(i.e. same ID, not necessarily same state) needs special attention. In this
case the recorded updates need to be compressed, since a worklist update
may only contain one update per worklist item. It is assumed, that every
revision only contains one added, removed or changed worklist item. To
compress these individual updates, only the first (since the source
revision) and the last recorded update of a certain worklist item need to
be considered: The state of the client worklist item (which is the key of
the map), is the state at the time of its last update.
The WorklistConstants.WorklistItemUpdateType (which is the value in the map) is
determined by looking at the type of the first and the last recorded update
for that item. The following shows the relevant combinations and their
results.
| type of first recorded update | type of last recorded update | resulting update type |
|---|---|---|
| ADDED | CHANGED | ADDED |
| ADDED | REMOVED | omit (NOTHING) |
| ADDED | ADDED_OR_CHANGED | ADDED |
| ADDED | REMOVED_OR_NOTHING | omit (NOTHING) |
| CHANGED | CHANGED | CHANGED |
| CHANGED | REMOVED | REMOVED |
| CHANGED | ADDED_OR_CHANGED | CHANGED |
| CHANGED | REMOVED_OR_NOTHING | REMOVED |
| REMOVED | ADDED | CHANGED |
| REMOVED | ADDED_OR_CHANGED | CHANGED |
| REMOVED | REMOVED_OR_NOTHING | REMOVED |
| ADDED_OR_CHANGED | CHANGED | ADDED_OR_CHANGED |
| ADDED_OR_CHANGED | REMOVED | REMOVED_OR_NOTHING |
| ADDED_OR_CHANGED | ADDED_OR_CHANGED | ADDED_OR_CHANGED |
| ADDED_OR_CHANGED | REMOVED_OR_NOTHING | REMOVED_OR_NOTHING |
| REMOVED_OR_NOTHING | ADDED | ADDED_OR_CHANGED |
| REMOVED_OR_NOTHING | ADDED_OR_CHANGED | ADDED_OR_CHANGED |
| REMOVED_OR_NOTHING | REMOVED_OR_NOTHING | REMOVED_OR_NOTHING |
getAll in interface WorklistUpdatepublic void assureWorklistItemAdded(ClientWorklistItem item)
WorklistConstants.WorklistItemUpdateType.ADDED. The designated worklist originally
had the update type WorklistConstants.WorklistItemUpdateType.ADDED_OR_CHANGED.
Assuring the update simplifies worklist update handling since soft states
are eliminated.item - The worklist item which had the soft update type
WorklistConstants.WorklistItemUpdateType.ADDED_OR_CHANGED and has
effectively been added. This changes its update type to
WorklistConstants.WorklistItemUpdateType.ADDED.public void assureWorklistItemChanged(ClientWorklistItem item)
WorklistConstants.WorklistItemUpdateType.CHANGED. The designated worklist originally
had the update type WorklistConstants.WorklistItemUpdateType.ADDED_OR_CHANGED.
Assuring the update simplifies worklist update handling since soft states
are eliminated.item - The worklist item which had the soft update type
WorklistConstants.WorklistItemUpdateType.ADDED_OR_CHANGED and has
effectively been changed. This changes its update type to
WorklistConstants.WorklistItemUpdateType.CHANGED.public void assureWorklistItemRemoved(ClientWorklistItem item)
WorklistConstants.WorklistItemUpdateType.REMOVED. The designated worklist originally
had the update type WorklistConstants.WorklistItemUpdateType.REMOVED_OR_NOTHING.
Assuring the update simplifies worklist update handling since soft states
are eliminated.item - The worklist item which had the soft update type
WorklistConstants.WorklistItemUpdateType.REMOVED_OR_NOTHING and has
effectively been removed. This changes its update type to
WorklistConstants.WorklistItemUpdateType.REMOVED.public void assureWorklistItemUnknown(ClientWorklistItem item)
WorklistConstants.WorklistItemUpdateType.REMOVED_OR_NOTHING. Assuring the update
simplifies worklist update handling since soft states are eliminated.item - The worklist item which had the soft update type
WorklistConstants.WorklistItemUpdateType.REMOVED_OR_NOTHING and has
effectively been unknown before. This removes the worklist item
from this update.S