Process API

filenet.vw.api
Class VWWorkBasket

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

public class VWWorkBasket
extends VWQueueQuery
implements java.io.Serializable

Use this class to retrieve information about a workbasket, its columns, filters, or query results.

Since:
P8 4.5.0
See Also:
Serialized Form

Nested Class Summary
static class VWWorkBasket.Column
          Represents a read-only, runtime column for the workbasket.
static class VWWorkBasket.Filter
          Represents a read-only, runtime filter for the workbasket.
static class VWWorkBasket.QueryResults
          Represents the query result as returned by the fetchNextBatch method.
 
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.
 VWWorkBasket.QueryResults fetchNextBatch(int query_flags, int buffer_size, java.lang.String sort_column, java.lang.String[] filter_names, java.lang.Object[] substitution_vars, java.lang.String lastWorkRecStr, int fetch_type)
          Gets the next batch of query results based on the specified criteria.
 VWAttributeInfo getAttributeInfo()
          Gets the workbasket attributes as paired labels (hashtable keys) and values in String format.
 java.lang.String getAuthoredName()
          Gets the original workbasket name.
 int getBufferSize()
          Gets the maximum number of elements set by the user to return in a fetch.
 VWWorkBasket.Column[] getColumns()
          Gets the columns defined for the workbasket.
 java.lang.String getDescription()
          Gets the work basket description.
 VWWorkBasket.Filter[] getFilters()
          Gets the filters defined for the workbasket.
 int getId()
          Gets the object ID of the workbasket.
 java.lang.String getName()
          Gets the current workbasket name.
 VWQueue getQueue()
          Gets the queue with which the workbasket is associated.
 java.lang.String getQueueName()
          Gets the name of the queue with which the workbasket is associated.
 int getRevision()
          Gets the revision number of the workbasket.
 void setBufferSize(int newSize)
          Sets the maximum number of elements to return in a fetch (defaults to 50).
 java.lang.String toString()
          Gets a String representation of the workbasket information.
 
Methods inherited from class filenet.vw.api.VWQueueQuery
fetchCount, fetchInstructionElements, fetchQueueElements, fetchWorkObjects, getElementType, hasNext, isDone, next, resetFetch
 
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.

Returns:
the file date

_get_FILE_AUTHOR

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

Returns:
the file author

_get_FILE_REVISION

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

Returns:
the file revision

getName

public java.lang.String getName()
                         throws VWException
Gets the current workbasket name. If a translated version exists, that version is returned.

Returns:
A String containing the name currently assigned to the workbasket.
Throws:
VWException

getAuthoredName

public java.lang.String getAuthoredName()
                                 throws VWException
Gets the original workbasket name.

Returns:
A String containing the name originally assigned to the workbasket.
Throws:
VWException

getDescription

public java.lang.String getDescription()
                                throws VWException
Gets the work basket description.

Returns:
A String containing the description of the workbasket.
Throws:
VWException

getQueueName

public java.lang.String getQueueName()
Gets the name of the queue with which the workbasket is associated.

Returns:
A String containing the name of the queue associated with the workbasket.

getId

public int getId()
Gets the object ID of the workbasket.

Returns:
An integer representing the object ID of the workbasket.

getRevision

public int getRevision()
                throws VWException
Gets the revision number of the workbasket.

Returns:
An integer indicating the revision number of the workbasket.
Throws:
VWException

getAttributeInfo

public VWAttributeInfo getAttributeInfo()
                                 throws VWException
Gets the workbasket attributes as paired labels (hashtable keys) and values in String format.

Returns:
A VWAttributeInfo object containing a hashtable of key (label) and value String pairs representing the attributes for the workbasket.
Throws:
VWException

getQueue

public VWQueue getQueue()
Gets the queue with which the workbasket is associated.

Overrides:
getQueue in class VWQueueQuery
Returns:
A VWQueue object representing the queue for the workbasket.
Throws:
VWException
See Also:
VWQueue

getColumns

public VWWorkBasket.Column[] getColumns()
Gets the columns defined for the workbasket.

Returns:
An array of the workbasket columns.

getFilters

public VWWorkBasket.Filter[] getFilters()
Gets the filters defined for the workbasket.

Returns:
An array of the workbasket filters.

fetchNextBatch

public VWWorkBasket.QueryResults fetchNextBatch(int query_flags,
                                                int buffer_size,
                                                java.lang.String sort_column,
                                                java.lang.String[] filter_names,
                                                java.lang.Object[] substitution_vars,
                                                java.lang.String lastWorkRecStr,
                                                int fetch_type)
                                         throws VWException
Gets the next batch of query results based on the specified criteria.

Parameters:
queryFlags - An integer value that specifies the query options.

Use the | and + operators to combine the flags. See the QUERY_* properties on VWQuery for descriptions of the possible query flags.

buffer_size - An integer value indicating the maximum number of elements to return. The default is 50.
sort_column - A String containing the name of the column to sort by.
filter_names - A String array of the names of the filters to use for the query.
substition_vars - An array of objects containing the values to substitute for the placeholder variables specified in the SQL WHERE clause(s) for the filter(s).

A VWWorkObjectNumber object can be used here in place of F_WobNum and F_WorkFlowNumber. Queries to DB2 databases must use VWWorkObjectNumber instead of F_WobNum or F_WorkFlowNumber.

If there are no placeholder variables in the specified filters, the values for the substitutionVars parameter will be ignored (and can be null). The array elements in this parameter are substituted, in corresponding order, for the placeholder variables in a filter.

Note: When using special SQL characters (such as, %), these characters need to be contained within the substitution string, and the entire substitution string must be quoted.

For example, if a filter contains three placeholder variables specified as ":A", there must be three corresponding substitution variables.

For example:

   {new Integer(1000),"Smith"} 

This substitutionVars parameter would have a corresponding filter with the following:

   integerA < 1000 AND stringB = "Smith" 

Note: Time columns in the database can be exposed as either 32-bit (can only support dates earlier than 2038) or 64-bit (can support dates beyond 2038). If a user has a filter on a 32-bit time field, the value bound to the bind variable in the query using that filter must be a value that can fit in 32-bits, otherwise the query will not return the expected result. For example:

    "my32bitColumn < :a"

will not work correctly if bound to the date value "11/11/2099"; however, binding it to the value "11/11/2037" will return the expected result.

As a further example, assume the object being queried contains a row with two exposed fields, atime64 (64-bit) and atime32 (32-bit), and both fields have the date/time value "11/11/2008 12:12:12".

Using the filter:

    String filter = "atime64 < :a AND atime32 < :b"; 

the following substitution variables will return the fetched row after applying the filter and substitutionVars in the query:

    Object[] subsVars = {sdf.parse("2040-01-01 12:00:00"), sdf.parse("2020-01-01 12:00:00")}; // works 

However, the following query will not be able to fetch the row, because it binds a value that will not fit in a 32-bit column:

    Object[] subsVars = {sdf.parse("2040-01-01 12:00:00"), sdf.parse("2040-01-01 12:00:00")}; // does not work. 
lastWorkRecStr - A base64-encoded String containing the last record of the query results. If this value is null, the query starts from the beginning.
fetchType - An integer value associated with the element type to be retrieved using the object returned by VWRosterQuery. Valid element type values must be one of the following:
  • 1: Work object (FETCH_TYPE_WORKOBJECT)
  • 2: Instruction element (FETCH_TYPE_INSTRUCTION_ELEMENT)
  • 3: Queue element (FETCH_TYPE_QUEUE_ELEMENT)
  • 5: Step element (FETCH_TYPE_STEP_ELEMENT)
Returns:
A QueryResults object containing the results of the query. If the end of the query results was reached in the preceding call to this method, null will be returned.
Throws:
VWException

toString

public java.lang.String toString()
Gets a String representation of the workbasket information.

Overrides:
toString in class VWQueueQuery
Returns:
A String containing the workbasket information.

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.