Process API

filenet.vw.api
Class VWQueueQuery

java.lang.Object
  extended by filenet.vw.api.VWQueueQuery
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
VWWorkBasket

public class VWQueueQuery
extends java.lang.Object

Use this class to query for queue elements, work objects, or Instruction elements. A given instance of this class returns a series of single type of item. A query completes when the next() method returns null a null value.

VWQueueQuery contains methods next() and hasNext() which function similarly to the next() and hasNext() methods in the Iterator interface in Java 2.

See Also:
VWQueue.startQuery(String, Object[], Object[], int, String, Object[]), VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int), VWQueue, VWQueueElement, VWWorkObject, VWStepElement, Serialized Form

Field Summary
static int QUERY_GET_NO_SYSTEM_FIELDS
          Deprecated. see VWRoster, VWQueue
static int QUERY_GET_NO_TRANSLATED_SYSTEM_FIELDS
          Deprecated. see VWRoster, VWQueue
static int QUERY_GET_SYSTEM_FIELDS
          Deprecated. Not replaced. This is the default.
static int QUERY_GET_TRANSLATED_SYSTEM_FIELDS
          Deprecated. Not replaced. This is the default.
See the queryFlags parameter of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int).
static int QUERY_LOCK_OBJECTS
          Deprecated. see VWQueue
static int QUERY_MAX_VALUES_INCLUSIVE
          Deprecated. see VWLog, VWRoster, VWQueue
static int QUERY_MIN_VALUES_INCLUSIVE
          Deprecated. see VWLog, VWRoster, VWQueue
static int QUERY_NO_OPTIONS
          Deprecated. see VWLog, VWRoster, VWQueue
static int QUERY_READ_BOUND
          Deprecated. see VWQueue
static int QUERY_READ_LOCKED
          Deprecated. see VWQueue
static int QUERY_READ_UNWRITABLE
          Deprecated. see VWRoster, VWQueue
static int QUERY_RESOLVE_NAMES
          Deprecated. see VWRoster, VWQueue
static int QUERY_TRANSLATE_QUERY_FILTER
          Deprecated. see VWRoster, VWQueue
 
Method Summary
static java.lang.String _get_FILE_AUTHOR()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_DATE()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_REVISION()
          For FileNet internal use only, do not call.
 int fetchCount()
          Gets the integer value indicating the number of records that can be retrieved, using this queueQuery object.
 VWInstructionElement[] fetchInstructionElements(int bufferSize)
          Deprecated. Replaced by next()
 VWQueueElement[] fetchQueueElements(int bufferSize)
          Deprecated. Replaced by next()
 VWWorkObject[] fetchWorkObjects(int bufferSize)
          Deprecated. Replaced by next()
 int getBufferSize()
          Gets the maximum number of elements set by the user to return in a fetch.
 int getElementType()
          Gets the fetch type of this VWQueueQuery object.
 VWQueue getQueue()
          Gets the queue retrieved by the VWQueue.createQuery() method or the deprecated VWQueue.startQuery() method.
 boolean hasNext()
          Indicates whether another element can be fetched from this VWQueueQuery instance.
 boolean isDone()
          Deprecated. Replaced by next()
 java.lang.Object next()
          Retrieves the subsequent element for this VWQueueQuery instance.
 void resetFetch()
          Resets the last element fetched for this queue query object.
 void setBufferSize(int newSize)
          Sets the maximum number of elements to return in a fetch (defaults to 50).
 java.lang.String toString()
          Retrieves a string version of the current query's queue name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_NO_OPTIONS

public static final int QUERY_NO_OPTIONS
Deprecated. see VWLog, VWRoster, VWQueue
Value 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 VWQueue
Value of 1..Flag Specifies that items returned from a query should include those that are already locked.
See the queryFlags parameter of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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 VWQueue
Value 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 of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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, VWQueue
Value of 4..Flag Specifies that items returned from a query should include those that are Read-only.
See the queryFlags parameter of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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 VWQueue
Value of 16..Flag Specifies that items returned from a query should become locked. See the queryFlags parameter of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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, VWQueue
Value 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 of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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, VWQueue
Value 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 of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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 of VWRoster.createQuery(java.lang.String, java.lang.Object[], java.lang.Object[], int, java.lang.String, java.lang.Object[], int) and VWQueue.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, VWQueue
Value 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, VWQueue
Value 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, VWQueue
Value 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, VWQueue
Value 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

_get_FILE_DATE

public static java.lang.String _get_FILE_DATE()
For FileNet internal use only, do not call.


_get_FILE_AUTHOR

public static java.lang.String _get_FILE_AUTHOR()
For FileNet internal use only, do not call.


_get_FILE_REVISION

public static java.lang.String _get_FILE_REVISION()
For FileNet internal use only, do not call.


fetchWorkObjects

public VWWorkObject[] fetchWorkObjects(int bufferSize)
                                throws VWException
Deprecated. Replaced by next()

Fetches a specific number of work objects. Call the method once for each work object the query being fetched. 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 return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchInstructionElements or the fetchQueueElements methods.

Parameters:
bufferSize - An integer value specifying the maximum number of Work Objects to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned work objects might be smaller than the number specified here.
Returns:
An array of VWWorkObjects that represents the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of work objects.

fetchQueueElements

public VWQueueElement[] fetchQueueElements(int bufferSize)
                                    throws VWException
Deprecated. Replaced by next()

Fetches a specific number of queue elements. Call the method once for each queue element being fetched. 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 return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchInstructionElements or the fetchWorkObjects methods.

Parameters:
bufferSize - An integer value specifying the maximum number of elements to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned elements might be smaller than the number specified in the parameter.
Returns:
An array of VWQueueElement objects that represent the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of queue elements.

fetchInstructionElements

public VWInstructionElement[] fetchInstructionElements(int bufferSize)
                                                throws VWException
Deprecated. Replaced by next()

Fetches a specific number of Instruction elements. Call the method once for each Instruction element being fetched. 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 return in a single fetch. An instance of this class returns only one type of item. Therefore, an error occurs if this call follows a call to the deprecated fetchQueueElements or the fetchWorkObjects methods.

Parameters:
bufferSize - An integer value specifying the maximum number of elements to return for each fetch operation. The value must be greater than zero (0). The server imposes a maximum; therefore, the number of returned elements might be smaller than the number specified in the parameter.
Returns:
An array of VWInstructionElement objects that represent the fetched items. If no more objects are available to fetch, the method returns a null value.
Throws:
VWException - Thrown if it cannot fetch a specific number of Instruction elements.

getQueue

public VWQueue getQueue()
Gets the queue retrieved by the VWQueue.createQuery() method or the deprecated VWQueue.startQuery() method.

Returns:
A Queue object retrieved by the VWQueue.startQuery() method.
See Also:
VWQueue

isDone

public boolean isDone()
Deprecated. Replaced by next()

Indicates whether the query completed.

Returns:
A Boolean value. The method returns true if no elements to fetch; otherwise, the method returns false, which indicates there are more elements to fetch.

toString

public java.lang.String toString()
Retrieves a string version of the current query's queue name.

Overrides:
toString in class java.lang.Object
Returns:
A string that contains the name of the queue.

resetFetch

public void resetFetch()
Resets the last element fetched for this queue query object. New fetch results include previously fetched elements.

Since:
VWWS3.10

getElementType

public int getElementType()
Gets the fetch type of this VWQueueQuery object.

Returns:
An integer value indicating the type of the elements.

Fetch types are:

  • -1: VWFetchType.FETCH_TYPE_NONE
  • 1: VWFetchType.FETCH_TYPE_WORKOBJECT
  • 2: VWFetchType.FETCH_TYPE_INSTRUCTION_ELEMENT
  • 3: VWFetchType.FETCH_TYPE_QUEUE_ELEMENT
  • 5: VWFetchType.FETCH_TYPE_STEP_ELEMENT

If VWFetchType.FETCH_TYPE_NONE (-1) returns, the application used the deprecated VWQueue.startQuery() method to create this object.

Since:
VWWS3.10

next

public java.lang.Object next()
                      throws VWException
Retrieves the subsequent element for this VWQueueQuery instance. Invoke this method repeatedly to retrieve a series of objects that can be cast to the fetch type of this VWQueueQuery object, as specified by the VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int) call that created this VWQueueQuery instance. Returns null when no more objects can be returned.

To use this method, create a VWQueueQuery object with a VWQueue.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 VWQueue.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 VWQueue.setBufferSize(int) call from the same instance of the VWQueue class that created the current VWQueueQuery object. In other words, after you reset the buffer size, you must create a new VWQueueQuery object (which will contain this next() method) with VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int). In the new instance of VWQueueQuery, 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 VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int) method that created the current VWQueueQuery 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 VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int) call.
Throws:
VWException - Various causes. A possible cause may be using the deprecated VWQueue.startQuery(String, Object[], Object[], int, String, Object[]) method to create the current VWQueueQuery instance, instead of a VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int) call.
Since:
VWWS3.10
See Also:
hasNext()

hasNext

public boolean hasNext()
                throws VWException
Indicates whether another element can be fetched from this VWQueueQuery instance.

Returns:
true if there are more elements that can be fetched.
Note
This method requires a buffer size greater than 1 to operate properly. The default buffersize is 50.
Throws:
VWException - Various causes. A possible cause may be using the deprecated VWQueue.startQuery(String, Object[], Object[], int, String, Object[]) method to create the current VWQueueQuery instance, instead of a VWQueue.createQuery(String, Object[], Object[], int, String, Object[], int) call.
See Also:
next()

fetchCount

public int fetchCount()
               throws VWException
Gets the integer value indicating the number of records that can be retrieved, using this queueQuery object. Results are approximate because the record set may change before the query returns.

Returns:
An integer value indicating the number of records that could be retrieved in the queue, using this VWQueueQuery object queue.
Throws:
VWException - Thrown if it cannot get the integer value indicating the number of records that can be retrieved, using this VWQueueQuery object queue. One cause of this is an incorrect query parameter.
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 VWException
Sets 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 0.

Process API

© Copyright IBM Corporation 2002, 2008. All rights reserved.