org.eclipse.stardust.engine.api.query
Class Worklist

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.eclipse.stardust.engine.api.query.Worklist
All Implemented Interfaces:
Serializable, Iterable, Collection, List, QueryResult
Direct Known Subclasses:
ParticipantWorklist, UserWorklist

public abstract class Worklist
extends AbstractList
implements QueryResult

Represents a worklist in it's hierarchical structure.

Version:
$Revision$
Author:
ubirkemeyer, rsauer
See Also:
Serialized Form

Method Summary
 Object get(int index)
           
 List getCumulatedItems()
          Retrieves a cumulated view of items belonging directly and indirectly to this worklist.
 int getCumulatedSize()
          Retrieves the number of items belonging directly and indirectly to this worklist.
abstract  ParticipantInfo getOwner()
          Retrieves the owning participant of this worklist.
abstract  String getOwnerID()
          The human readable ID of the worklist owner.
abstract  String getOwnerName()
          The name of the owner of the worklist.
abstract  long getOwnerOID()
          The OID of the owner of this worklist.
 WorklistQuery getQuery()
          Retrieves the query this worklist is based on.
 SubsetPolicy getSubsetPolicy()
          Retrieves the subset policy this worklist is based on.
abstract  Iterator getSubWorklists()
          Retrieves an iterator over all contained sub-worklists.
 long getTotalCount()
          Gets the optionally evaluated count of all items satisfying the query this result is based on.
 long getTotalCountThreshold()
          This returns the configured threshold up to which total count is counted exactly.
 boolean hasMore()
          Indicates if there are more worklist items available (maybe inherited from participant contributions) in either this worklist or any of its participant contributions than allowed by the contribution definition's SubsetPolicy.
 boolean hasMorePrivateItems()
          Indicates if there are more noninherited items available in this worklist (i.e.
abstract  boolean isUserWorklist()
          Indicates if the worklist is a user worklist or a participant worklist.
 int size()
          Retrieves the number of items belonging directly to this worklist.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Method Detail

getOwner

public abstract ParticipantInfo getOwner()
Retrieves the owning participant of this worklist.

Returns:
The owning participant.

isUserWorklist

public abstract boolean isUserWorklist()
Indicates if the worklist is a user worklist or a participant worklist.

User worklists may contain nested sub-worklists, while participant worklists can't.

Returns:
true in case of a user worklist, false in case of a participant worklist.

getOwnerOID

public abstract long getOwnerOID()
The OID of the owner of this worklist.

If the worklist belongs to a participant not existing anymore in the current model version the OID will be 0.

Returns:
The owner's OID.
See Also:
getOwnerID()

getOwnerID

public abstract String getOwnerID()
The human readable ID of the worklist owner.

Returns:
The owner's ID.
See Also:
getOwnerOID()

getOwnerName

public abstract String getOwnerName()
The name of the owner of the worklist.

If the worklist belongs to a participant not existing anymore in the current model version the name will be empty.

Returns:
The owner's name.
See Also:
getOwnerID()

getQuery

public WorklistQuery getQuery()
Retrieves the query this worklist is based on.

Returns:
The WorklistQuery the worklist is based on.

getSubWorklists

public abstract Iterator getSubWorklists()
Retrieves an iterator over all contained sub-worklists.

Only user worklists may contain sub-worklists.

Returns:
An iterator over all conatined sub-worklists. The elements of the iterator are in turn of type Worklist.
See Also:
isUserWorklist()

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

size

public int size()
Retrieves the number of items belonging directly to this worklist.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
The number of items directly belonging to this worklist, possibly constrained by its SubsetPolicy. The size of possibly existing sub-worklist is not taken into account.
See Also:
getCumulatedSize(), List.iterator()

getTotalCount

public long getTotalCount()
                   throws UnsupportedOperationException
Description copied from interface: QueryResult
Gets the optionally evaluated count of all items satisfying the query this result is based on.

As evaluating the total count is probably an expensive operation, it will only be done on request. Requesting the total count has to be done by attaching an appropriate SubsetPolicy.

If no subset policy is used, the total count of items is equal the size of the query result.

Specified by:
getTotalCount in interface QueryResult
Returns:
The total count of items satisfying the query, if requested by the subset policy used.
Throws:
UnsupportedOperationException - if the evaluation of the total count was not requested
See Also:
SubsetPolicy.isEvaluatingTotalCount()

getSubsetPolicy

public SubsetPolicy getSubsetPolicy()
Retrieves the subset policy this worklist is based on.

Specified by:
getSubsetPolicy in interface QueryResult
Returns:
The SubsetPolicy the worklist is based on.

hasMore

public boolean hasMore()
Indicates if there are more worklist items available (maybe inherited from participant contributions) in either this worklist or any of its participant contributions than allowed by the contribution definition's SubsetPolicy.

Specified by:
hasMore in interface QueryResult
Returns:
true if there are more items available in this worklist, false if not.
See Also:
hasMorePrivateItems(), getSubsetPolicy()

hasMorePrivateItems

public boolean hasMorePrivateItems()
Indicates if there are more noninherited items available in this worklist (i.e. the user's private worklist or a specific participant's worklist) than allowed by its SubsetPolicy.

Returns:
true if there are more noninherited items available in this worklist, false if not.
See Also:
getSubsetPolicy()

getCumulatedSize

public int getCumulatedSize()
Retrieves the number of items belonging directly and indirectly to this worklist.

Returns:
The number of items directly and indirectly belonging to this worklist, possibly constrained by its SubsetPolicy. The size of possibly existing sub-worklist is taken into account.
See Also:
size(), getCumulatedItems()

getCumulatedItems

public List getCumulatedItems()
Retrieves a cumulated view of items belonging directly and indirectly to this worklist.

As the cumulation takes place client-side any order criterion associated with the query will not be applied to the cumulated view, thus resulting in a partially ordered list. A globally ordered list may be obtained by an apropriate ActivityInstanceQuery.

Returns:
The items directly and indirectly belonging to this worklist, possibly constrained by its SubsetPolicy.
See Also:
getCumulatedSize()

getTotalCountThreshold

public long getTotalCountThreshold()
Description copied from interface: QueryResult
This returns the configured threshold up to which total count is counted exactly. If this value is exceeded then #getTotalCount() will return {Long.MAX_VALUE)

Specified by:
getTotalCountThreshold in interface QueryResult
Returns:
{Long.MAX_VALUE} if no threshold value is configured. Otherwise configured value.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.