|
Process API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfilenet.vw.api.VWRoster
public final class VWRoster
Use this class to access the contents of a roster or manage
running workflows. Create an instance of this class with
VWSession.getRoster(). Create a query object for
an instance of this class with
VWRoster.createQuery
.
VWSession
,
Serialized FormField Summary | |
---|---|
static int |
QUERY_GET_NO_SYSTEM_FIELDS
Value of 1024. Include this value in the queryFlags parameter of the createQuery() method to return objects without system fields. |
static int |
QUERY_GET_NO_TRANSLATED_SYSTEM_FIELDS
Value of 2048. Include this value in the queryFlags parameter of the createQuery() method to return objects without translated fields. |
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. |
static int |
QUERY_MAX_VALUES_INCLUSIVE
Value of 64. Pass this value in the queryFlags parameter of the createQuery method to specify the inclusion of maximum search values. |
static int |
QUERY_MIN_VALUES_INCLUSIVE
Value of 32. Pass this value in the queryFlags parameter of the createQuery method to specify the inclusion of minimum search values. |
static int |
QUERY_NO_OPTIONS
Value of 0. Pass this value in the queryFlags parameter of the createQuery method to specify no search option. |
static int |
QUERY_READ_UNWRITABLE
Value of 4. Pass this value in the queryFlags parameter of the createQuery method to specify the return of Read-only work items. |
static int |
QUERY_RESOLVE_NAMES
Value of 8192. |
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. |
VWRosterQuery |
createQuery(java.lang.String indexName,
java.lang.Object[] minValues,
java.lang.Object[] maxValues,
int queryFlags,
java.lang.String filter,
java.lang.Object[] substitutionVars,
int fetchType)
Performs a filtered fetch of roster items. |
int |
fetchCount()
Gets an integer that indicates the number of work items in the roster. |
VWRosterDefinition |
fetchRosterDefinition()
Fetches the definition for this roster. |
VWRosterStats |
fetchStatistics(java.util.Date startTime,
java.util.Date endTime,
int timeUnits)
Fetches statistical information for the roster, given a start and stop time. |
java.lang.String |
getAuthoredName()
Return the authored name |
int |
getBufferSize()
Gets an integer value indicating the maximum number of elements to return in a fetch. |
int |
getCount()
Deprecated. Replaced by fetchCount() |
java.lang.String |
getName()
Return the translated name |
VWSession |
getServiceSession()
Identifies the session that originated the search object. |
void |
setBufferSize(int newSize)
Sets the integer value for the maximum number of elements to return in a fetch. |
VWRosterQuery |
startQuery(java.lang.String indexName,
java.lang.Object[] minValues,
java.lang.Object[] maxValues,
int queryFlags,
java.lang.String filter,
java.lang.Object[] substitutionVars)
Deprecated. Replaced by createQuery |
java.lang.String |
toString()
Gets the roster name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int QUERY_NO_OPTIONS
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)].
public static final int QUERY_READ_UNWRITABLE
Setting this flag causes the application to read unwritable work items; not setting it causes the return of only writable work items.
public static final int QUERY_MIN_VALUES_INCLUSIVE
public static final int QUERY_MAX_VALUES_INCLUSIVE
public static final int QUERY_GET_SYSTEM_FIELDS
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.
public static final int QUERY_GET_TRANSLATED_SYSTEM_FIELDS
public static final int QUERY_GET_NO_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.
public static final int QUERY_GET_NO_TRANSLATED_SYSTEM_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.
public static final int QUERY_RESOLVE_NAMES
VWQuery#QUERY_RESOLVE_NAMES
,
VWLog.QUERY_RESOLVE_NAMES
,
Constant Field ValuesMethod Detail |
---|
public static java.lang.String _get_FILE_DATE()
public static java.lang.String _get_FILE_AUTHOR()
public static java.lang.String _get_FILE_REVISION()
public int getCount() throws VWException
fetchCount()
VWException
- Thrown if the roster size cannot be
determined.public int fetchCount() throws VWException
VWException
- Thrown if the roster size cannot be
determined.public VWRosterQuery startQuery(java.lang.String indexName, java.lang.Object[] minValues, java.lang.Object[] maxValues, int queryFlags, java.lang.String filter, java.lang.Object[] substitutionVars) throws VWException
createQuery
Specifying search conditions in this method causes the retrieval of roster items based on a filter condition and a range in a search index. Use the following to limit your search:
A roster item must match all fetch criteria specified in the parameters to return.
indexName
- The name of the database
search index for the roster. Specify either the name assigned
to the index at the Configuration Console (this may be a
user-defined search field, a system search field, or both) or a
system search field name.
The standard system search fields for rosters are listed below:
minValues
- An array of objects containing the minimum
values with which to compare the index fields.
The type of the array elements must correspond to the field types in the search index. If the number of minValues array elements is smaller than the number of search fields, the application assumes the fields at the end of the search index have no value. The array element must be of a Java type that corresponds to a Process type (integer, float, boolean, or string). For example, java.lang.Integer corresponds to integer.
For example, the index named 'myIndex' is an integer, followed by a string, followed by a boolean, followed by a float, followed by a time-type value:
myIndex = integerA + stringB + booleanC + floatD + timeE
Set sample minimum values, against which to compare the index, as follows:
Object[] minValues = {new Integer(1000), "aardvark",
new Boolean(true), new Float(0012345678.369), new Time([date&time value])}
maxValues
- An array of maximum values with which to compare
the index fields.
The type of the array elements must correspond to the field types in the search index. If the number of maxValues array elements is smaller than the number of search fields, the application assumes that the fields at the end of the search index have no value. The array element must be of a Java type that corresponds to a Process type (integer, float, boolean, or string). For example, java.lang.Integer corresponds to integer.
queryFlags
- An integer value that specifies the search options
Setting this parameter refines the search for the work items
specified by the search index. Use | and + operators to combine
the options. See the Field Detail section for description of
these query flags:
filter
- A string containing a SQL statement used to
specify filter conditions (used with values input to the
substitutionVars parameter).
Use this parameter with the parameter settings for minValues, maxValues, and queryFlags to refine the your search. Input a SQL where-clause that contains a search field name on the left side of a boolean operator and a substitution placeholder on the right side of the operator.
For example: if filter input is similar to the following SQL statements:
integerA < :A AND stringB =:A
This filter will make the object pass the filter only if it meets two conditions:
In the SQL statement, a colon (:) precedes each placeholder on the right side of the statement.
A search field must be a variable or a roster field, for example: F_Tag=:name. Using this filter requires that you substitute the placeholder to the right of each colon with a value you pass to the corresponding substitutionVars parameter.
substitutionVars
- An array of objects that contain the
values to substitute for the variable names to the right of
the colons in the SQL statement you passed to the filter
parameter.
A substitution variable must begin with colon. If there is no variable in the filter parameter, the values for this parameter can be null. The array elements in this parameter substitute for the corresponding array elements in the filter parameter array. The filter parameter array elements act as place holders and must be substituted. For example, if three names are :A, a user needs three distinct substitution variables.
For example, if you pass the following:
{new Integer(1000),"Smith"}
to the substitutionVars parameter to accompany the example for filter input, the object has to meet the following conditions to return:
integerA < 1000 AND stringB = "Smith"
example : "my32bitColumn < :a", will not work correctly if bound to a date value like "11/11/2099", It will work fine if you bind it to a value like "11/11/2037".
Java code example, assume the roster being queried contains row with two exposed fields, atime64 (64-bit) and atime32 (32-bit) values, both fields have the same value - a date like "11/11/2008 12:12:12"
With this filter :
String filter = "atime64 < :a AND atime32 < :b";
the following substitution variables will return the row when fetching after using the filter and subvars in a query:
Object[] subsVars = {sdf.parse("2040-01-01 12:00:00"), sdf.parse("2020-01-01 12:00:00")}; // works
But the following filter will NOT find the row, because it binds a value that won't fit in 32-bits to a 32-bit column
Object[] subsVars = {sdf.parse("2040-01-01 12:00:00"), sdf.parse("2040-01-01 12:00:00")}; // doesn't work.
VWException
- Thrown if the method cannot
fetch roster items.public VWRosterQuery createQuery(java.lang.String indexName, java.lang.Object[] minValues, java.lang.Object[] maxValues, int queryFlags, java.lang.String filter, java.lang.Object[] substitutionVars, int fetchType) throws VWException
This method employs the following kinds of condition descriptors to define the filters:
For this method to successfully return a given roster item, the roster item must pass all the fetch criteria specified by the input parameters.
indexName
- The name of the database search index
for the queue. Enter either the name assigned to the index at the
Configuration Console or a system field name.
Note: An index assigned through the Configuration Console can be a user or system-defined search field, or it can be both.
The standard system search fields for queues are:
minValues
- An array of objects containing the minimum
values with which to compare the index fields.
Array element data types must match the corresponding data types in the search index. If the number of minValues array elements is smaller than the number of search fields, the unmatched search fields are ignored. The array elements must be of a Java type that corresponds to a Process Engine type (integer, float, boolean, or string). Strings must be the authored strings.
For example:
myIndex = integerA + stringB + booleanC; Object[] minValues = {new Integer(1000), "aardvark", new Boolean(true)};
maxValues
- An array of objects containing the maximum
values with which to compare the index fields.
Array element data types must match the corresponding data types in the search index. If the number of maxValues array elements is smaller than the number of search fields, the unmatched search fields are ignored. The array elements must be of a Java type that corresponds to a Process Engine type (integer, float, boolean, or string). Strings must be the authored strings.
queryFlags
- An integer value that specifies the search
options.
Setting this parameter refines the search for the work items
specified by the search index. Use the | and + operators to
combine the the flags. See the query properties for this instance
and the QUERY_* properties on VWQuery
for
descriptions of the possible query flags.
filter
- A SQL WHERE clause used as a filter, and having placeholder
variables that are replaced by values in the substitutionVars parameter.
Use this parameter with the parameter settings for minValues, maxValues, and queryFlags to refine the search. The SQL WHERE clause should contain a search field name on the left side of a boolean operator and a placeholder variable on the right side of the operator.
The field names are processed as SQL column names. For this reason, it is important that you do no use SQL function names as field names.
For example:
integerA < :A AND stringB =:B
specifies that an object satisfies the filter if it meets two conditions:
Use the following guidelines when creating the filter:
substitutionVars
- An array of objects containing the
values to substitute for the placeholder variables specified in the
SQL WHERE clause for the filter parameter.
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 is no placeholder variable in the filter parameter, 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 the filter parameter.
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 the filter parameter 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 parameter of 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 roster 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.
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:
VWRosterQuery.next
method.
A user must have appropriate access privileges to the queue to fetch work items (using the FETCH_TYPE_WORKOBJECT fetchType) or queue elements (using the FETCH_TYPE_QUEUE_ELEMENT fetchType). However, users may fetch their own instruction elements or step elements, regardless of queue access privilege.
VWException
- Thrown if the specified fetch type is invalid.VWFetchType
public VWSession getServiceSession()
public VWRosterStats fetchStatistics(java.util.Date startTime, java.util.Date endTime, int timeUnits) throws VWException
startTime
- A date value indicating the time to start
gathering statistics.endTime
- A date value indicating the time to stop
gathering statistics.timeUnits
- An integer value indicating the unit of time
for gathering statistics. Valid integer values for associated
with the time units are as follows:
VWException
- Thrown if the statistical information for the roster cannot be retrieved.VWTimeUnitType.MINUTES
,
VWTimeUnitType.HOURS
,
VWTimeUnitType.DAYS
,
VWTimeUnitType.WEEKS
,
VWTimeUnitType.MONTHS
,
VWTimeUnitType.YEARS
public java.lang.String toString()
toString
in class java.lang.Object
public int getBufferSize()
public void setBufferSize(int newSize) throws VWException
newSize
- An integer value specifying the maximum number
of elements to return in a fetch. The value must be greater
than 0.
VWException
- Thrown if the
buffer size specified in the newSize parameter is less than or
equal to 0.public VWRosterDefinition fetchRosterDefinition() throws VWException
VWException
- Thrown if the definition for this roster cannot be retrieved.public java.lang.String getAuthoredName()
public java.lang.String getName()
|
Process API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |