Class VWRosterQuery
- java.lang.Object
-
- filenet.vw.api.VWRosterQuery
-
- All Implemented Interfaces:
- java.io.Serializable
public final class VWRosterQuery extends java.lang.ObjectUse this class to query roster elements or work objects.A given instance of this class returns a single type of item. A query completes when the next() method returns null values.
Roster queries support distributed transactions
VWRosterQuery contains methods
VWRosterQuery.next()andVWRosterQuery.hasNext()which function similarly to the next() and hasNext() methods in the Iterator interface in Java 2.
-
-
Field Summary
Fields Modifier and Type Field and Description static intQUERY_GET_NO_SYSTEM_FIELDSDeprecated.see VWRoster, VWQueuestatic intQUERY_GET_NO_TRANSLATED_SYSTEM_FIELDSDeprecated.see VWRoster, VWQueuestatic intQUERY_GET_SYSTEM_FIELDSDeprecated.Not replaced. This is the default.static intQUERY_GET_TRANSLATED_SYSTEM_FIELDSDeprecated.Not replaced. This is the default.
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).static intQUERY_LOCK_OBJECTSDeprecated.see VWQueuestatic intQUERY_MAX_VALUES_INCLUSIVEDeprecated.see VWLog, VWRoster, VWQueuestatic intQUERY_MIN_VALUES_INCLUSIVEDeprecated.see VWLog, VWRoster, VWQueuestatic intQUERY_NO_OPTIONSDeprecated.see VWLog, VWRoster, VWQueuestatic intQUERY_READ_BOUNDDeprecated.see VWQueuestatic intQUERY_READ_LOCKEDDeprecated.see VWQueuestatic intQUERY_READ_UNWRITABLEDeprecated.see VWRoster, VWQueuestatic intQUERY_RESOLVE_NAMESDeprecated.see VWRoster, VWQueuestatic intQUERY_TRANSLATE_QUERY_FILTERDeprecated.see VWRoster, VWQueue
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description intfetchCount()Returns the number of records that can be retrieved for the current VWRosterQuery object.VWRosterElement[]fetchRosterElements(int bufferSize)Deprecated.Replaced byVWRosterQuery.next()VWWorkObject[]fetchWorkObjects(int bufferSize)Deprecated.Replaced byVWRosterQuery.next()intgetBufferSize()Gets the maximum number of elements set by the user to return in a fetch.intgetElementType()Gets the fetch type for the VWRosterQuery object.java.lang.StringgetLastRecord()Gets the last record in the query results.VWRostergetRoster()Gets a roster that was retrieved by the query initiated by either the VWRoster.createQuery() or VWRoster#startQuery(String, Object[], Object[], int, String, Object[]) methods.booleanhasNext()Indicates whether another element can be fetched from this VWRosterQuery instance.booleanisDone()Deprecated.Replaced byVWRosterQuery.next().java.lang.Objectnext()Retrieves the subsequent element for this VWRosterQuery instance. Invoke this method repeatedly to retrieve a series of objects that can be cast to the fetch type of this VWRosterQuery object, as specified by theVWRoster.createQuery(String, Object[], Object[], int, String, Object[], int)call that created this VWRosterQuery instance.voidresetFetch()Resets the last element fetched for this RosterQuery object.voidsetBufferSize(int newSize)Sets the maximum number of elements to return in a fetch (defaults to 50).voidsetLastRecord(java.lang.String lastWorkRecStr)Set the last record in the query resultjava.lang.StringtoString()Gets the name of the roster retrieved in a query.
-
-
-
Field Detail
-
QUERY_NO_OPTIONS
public static final int QUERY_NO_OPTIONS
Deprecated. see VWLog, VWRoster, VWQueueValue of 0.Flag Pass this value in the queryFlags parameter of the createQuery method to specify no search option.After passing this value, the returned work items are unlocked, unbound, and writable. If you use this flag in conjunction with another flag, the value of the other flag becomes the value input to the parameter [for example, 0(this value) + n(another flag value) = n(the other flag value)].
- See Also:
- Constant Field Values
-
QUERY_READ_LOCKED
public static final int QUERY_READ_LOCKED
Deprecated. see VWQueueValue of 1..Flag Specifies that items returned from a query should include those that are already locked.
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_READ_BOUND
public static final int QUERY_READ_BOUND
Deprecated. see VWQueueValue of 2..Flag Specifies that items returned from a query should include those that are already bound to a user or machine.
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_READ_UNWRITABLE
public static final int QUERY_READ_UNWRITABLE
Deprecated. see VWRoster, VWQueueValue of 4..Flag Specifies that items returned from a query should include those that are Read-only.
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_LOCK_OBJECTS
public static final int QUERY_LOCK_OBJECTS
Deprecated. see VWQueueValue of 16..Flag Specifies that items returned from a query should become locked. See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_MIN_VALUES_INCLUSIVE
public static final int QUERY_MIN_VALUES_INCLUSIVE
Deprecated. see VWLog, VWRoster, VWQueueValue of 32..Flag Specifies that minimum values passed in a query are inclusive, i.e. the comparison should be "greater than or equal to" rather than "greater than" (which is the default).
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_MAX_VALUES_INCLUSIVE
public static final int QUERY_MAX_VALUES_INCLUSIVE
Deprecated. see VWLog, VWRoster, VWQueueValue of 64..Flag Specifies that maximum values passed in a query are inclusive, i.e. the comparison should be "less than or equal to" rather than "less than" (which is the default).
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).- See Also:
- Constant Field Values
-
QUERY_GET_SYSTEM_FIELDS
public static final int QUERY_GET_SYSTEM_FIELDS
Deprecated. Not replaced. This is the default.Value of 256. Flag Pass this value in the queryFlags parameter of the createQuery method to specify the return of system field names and values.Use the system fields for additional queries on objects. A method that requires translation returns a default value (null, 0, or false). Helper methods require the QUERY_GET_TRANSLATED_SYSTEM_FIELDS to function properly.
- See Also:
- Constant Field Values
-
QUERY_GET_TRANSLATED_SYSTEM_FIELDS
public static final int QUERY_GET_TRANSLATED_SYSTEM_FIELDS
Deprecated. Not replaced. This is the default.
See the queryFlags parameter ofVWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int)andVWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).Value of 512..Flag Specifies that the query items returned from the query should include translated system field values.- See Also:
- Constant Field Values
-
QUERY_GET_NO_SYSTEM_FIELDS
public static final int QUERY_GET_NO_SYSTEM_FIELDS
Deprecated. see VWRoster, VWQueueValue of 1024.Flag Include this value in the queryFlags parameter of the createQuery() method to return objects without system fields.System fields and translated system fields are used in the helper methods for each object. Note that VWWorkObject objects have system fields that are not present in VWStepElement objects.
A method that requires translation returns a default value (null, 0, or false) for this flag. This is because related helper methods require the system fields and translated system fields to function properly.
- See Also:
- Constant Field Values
-
QUERY_GET_NO_TRANSLATED_SYSTEM_FIELDS
public static final int QUERY_GET_NO_TRANSLATED_SYSTEM_FIELDS
Deprecated. see VWRoster, VWQueueValue of 2048.Flag Include this value in the queryFlags parameter of the createQuery() method to return objects without translated fields.Use for performance enhancement when methods on a retrieved object are not needed and only the returned data itself is needed.
System fields and translated system fields are used in the helper methods for each object. Note that VWWorkObject objects have system fields that are not present in VWStepElement objects. A VWStepElement object contains only parameter data if this flag is used. However, a VWWorkObject object will contain system fields even if this flag is used.
A method that requires translation returns a default value (null, 0, or false) for this flag. This is because related helper methods require the system fields and translated system fields to function properly.
- See Also:
- Constant Field Values
-
QUERY_RESOLVE_NAMES
public static final int QUERY_RESOLVE_NAMES
Deprecated. see VWRoster, VWQueueValue of 8192..Flag Indicates query is to parse the maxValues, minValues, filter and substitutionVars values for user name and class substitution of strings to IDs. This supports conversion of user names to ids for Process Engine Web Services to perform queries using user ID fields within an index or filter (used when querying for rosters, queues and logs). Process Engine Web Services is stateless, so the conversion of name to ID within the index and filter values is done on the PE server.- See Also:
- Constant Field Values
-
QUERY_TRANSLATE_QUERY_FILTER
public static final int QUERY_TRANSLATE_QUERY_FILTER
Deprecated. see VWRoster, VWQueueValue of 8192..Flag Indicates query is to parse the maxValues, minValues, filter and substitutionVars values for user name and class substitution of strings to IDs. This constant has been renamed to QUERY_RESOLVE_NAMES. This supports conversion of user names to ids for Process Engine Web Services to perform queries using user ID fields within an index or filter (used when querying for rosters, queues and logs). Process Engine Web Services is stateless, so the conversion of name to ID within the index and filter values is done on the PE server.- See Also:
- Constant Field Values
-
-
Method Detail
-
fetchRosterElements
public VWRosterElement[] fetchRosterElements(int bufferSize) throws VWException
Deprecated. Replaced byVWRosterQuery.next()Fetches a specified number of roster elements. Call the method repeatedly to retrieve the needed number of roster elements for the query. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, the remaining elements are returned in a single fetch.An instance of this class can only return a single item type. Therefore, an error occurs if the next() method has previously been called.
- Parameters:
bufferSize- A positive integer value specifying the maximum number of elements to return in a fetch operation. The final number of returned elements will be the lesser of this value, the Process Server's size limit, and the total number of roster elements remaining to be fetched.- Returns:
- An array of VWRosterElement objects that represents the fetched items. If no more elements can be fetched, the method returns null.
- Throws:
VWException- Various causes. A possible cause may be the creation of the current VWRosterQuery object by the VWRoster.createQuery method.
-
fetchWorkObjects
public VWWorkObject[] fetchWorkObjects(int bufferSize) throws VWException
Deprecated. Replaced byVWRosterQuery.next()Fetches a specified number of work objects. Call this method repeatedly to retrieve the needed number of work objects for the query. If the number of requested elements (specified in the bufferSize parameter) is greater than the number of elements returned in the query, all remaining elements are returned in a single fetch.An instance of this class can return only one type of item. Therefore, an error occurs if the next or fetchRosterElements method has previously been called.
- Parameters:
bufferSize- An integer value specifying the maximum number of elements to return in a fetch operation. Specify a value greater than 0 (zero). The server imposes a maximum limit; therefore, the number of returned elements might be smaller than the number specified in this parameter - if the number of work objects is large enough.- Returns:
- An array of VWWorkObject objects that represent the fetched items. If no more elements can be fetched, the method returns null.
- Throws:
VWException- Thrown if it cannot fetch a specified number of work objects.
-
getRoster
public VWRoster getRoster()
Gets a roster that was retrieved by the query initiated by either the VWRoster.createQuery() or VWRoster#startQuery(String, Object[], Object[], int, String, Object[]) methods.- Returns:
- A VWRoster object that represents the query result for either the VWRoster.createQuery() or VWRoster#startQuery(String, Object[], Object[], int, String, Object[]) methods.
- See Also:
VWRoster
-
isDone
public boolean isDone() throws VWExceptionDeprecated. Replaced byVWRosterQuery.next().Determines whether the query is complete.- Returns:
trueif all available elements have been fetched, indicating the query has completed;false, otherwise.- Throws:
VWException- The method throws an exception if the current VWRosterQuery instance was created with a call toVWRoster.createQuery(String, Object[], Object[], int, String, Object[], int). For VWRosterQuery instances created with VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int), use theVWRosterQuery.hasNext()method to determine the query's completion status.
-
toString
public java.lang.String toString()
Gets the name of the roster retrieved in a query.- Overrides:
toStringin classjava.lang.Object- Returns:
- The name of the roster retrieved as a result of a query.
-
getElementType
public int getElementType()
Gets the fetch type for the VWRosterQuery object.- Returns:
- An integer value associated with the element type to
be retrieved.
Valid fetch type values are as follows:
- -1: None (VWFetchType.FETCH_TYPE_NONE); this value is returned only if the deprecated method VWRoster.startQuery was used to create this object.
- 1: work object (VWFetchType.FETCH_TYPE_WORKOBJECT)
- 4: Roster element (VWFetchType.FETCH_TYPE_ROSTER_ELEMENT)
- See Also:
VWFetchType.FETCH_TYPE_WORKOBJECT,VWFetchType.FETCH_TYPE_ROSTER_ELEMENT
-
next
public java.lang.Object next() throws VWExceptionRetrieves the subsequent element for this VWRosterQuery instance. Invoke this method repeatedly to retrieve a series of objects that can be cast to the fetch type of this VWRosterQuery object, as specified by theVWRoster.createQuery(String, Object[], Object[], int, String, Object[], int)call that created this VWRosterQuery instance. Returns null when no more objects can be returned.Supports distributed transactions
To use this method, create a VWRosterQuery object with a VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call, which specifies a range of objects to be fetched, a SQL filter expression, and the type of object to be fetched. The resulting query object will use a default buffer size of 50 retrieved items.
After a set of items in the current retrieval buffer is exhausted, additional items will be retrieved from the Process server and buffered. The effective buffer block size is the lesser of the number specified with a preceding
VWRoster.setBufferSize(int)call and the number imposed by the Process server limit.You can modify retrieval performance by changing the retrieval buffer size. To change the current retrieval buffer size, set it with a VWRoster.setBufferSize(int) call from the same instance of the VWRoster class that created the current VWRosterQuery object. In other words, after you reset the buffer size, you must create a new VWRosterQuery object (which will contain this next() method) with
VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int). In the new instance of VWRosterQuery, the next() method will use the new buffer size.
Note
This method requires a buffer size greater than 1 to operate properly.- Returns:
- An object that represents an item of the fetch type
specified in the VWRoster.createQuery(String, Object[],
Object[], int, String, Object[], int) method that created
the current VWRosterQuery object, or null (indicating there
are no more objects in the series).
Note
The returned object should be cast to the fetch type specified by the creating VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call. - Throws:
VWException- Various causes. A possible cause may be using the deprecatedVWRoster.startQuery(String, Object[], Object[], int, String, Object[])method to create the current VWRosterQuery instance, instead of a VWRoster.createQuery(String, Object[], Object[], int, String, Object[], int) call.- See Also:
VWRosterQuery.hasNext()
-
resetFetch
public void resetFetch()
Resets the last element fetched for this RosterQuery object. Previously fetched elements will be included in the new fetch results.- Since:
- VWWS3.10
-
hasNext
public boolean hasNext() throws VWExceptionIndicates whether another element can be fetched from this VWRosterQuery instance.
Note
This method requires a buffer size greater than 1 to operate properly. The default buffersize is 50.- Returns:
trueif there are more elements that can be fetched.- Throws:
VWException- Various causes. A possible cause may be using the deprecatedVWRoster.startQuery(String, Object[], Object[], int, String, Object[])method to create the current VWRosterQuery instance, instead of aVWRoster.createQuery(String, Object[], Object[], int, String, Object[], int)call.- See Also:
VWRosterQuery.next()
-
fetchCount
public int fetchCount() throws VWExceptionReturns the number of records that can be retrieved for the current VWRosterQuery object.- Returns:
- The number of records that could be retrieved in the
roster for the current VWRosterQuery object.
Note
The record set may change before the query returns, so the result should be treated as approximate. - Throws:
VWException- Various causes. A possible cause may be an unsupported fetch type.- Since:
- VWWS3.10
-
getBufferSize
public int getBufferSize()
Gets the maximum number of elements set by the user to return in a fetch. The default value is 50.- Returns:
- An integer value indicating the maximum number of elements to return in a fetch.
- Since:
- VWWS4.0
-
setBufferSize
public void setBufferSize(int newSize) throws VWExceptionSets the maximum number of elements to return in a fetch (defaults to 50). The server imposes a maximum limit of 100. The number returned may be smaller if the items are very large.- Parameters:
newSize- This must be greater than zero.- Throws:
VWException- Thrown if buffer size is less than or equal to 0 (zero).
-
getLastRecord
public java.lang.String getLastRecord()
Gets the last record in the query results.- Returns:
- A base64-encoded String containing the last record of the query results. Null is returned if no last record.
- Since:
- CPE 5.2.0.3
-
setLastRecord
public void setLastRecord(java.lang.String lastWorkRecStr)
Set the last record in the query result- Parameters:
lastWorkRecStr- A base64-encoded String containing the last record of the query results. If this value is null, the query starts from the beginning.- Since:
- CPE 5.2.0.3
-
-