Process Class Relationships

filenet.vw.api
Class VWLog

java.lang.Object
  |
  +--filenet.vw.api.VWLog

public final class VWLog
extends java.lang.Object

Use this class to query logs, determine the associated session, and access the log definition. The VWSession.fetchEventLog() method instantiates this class. Once you have an VWLog object, you can query logs, based on different query criteria.

Since:
VWWS3.10
See Also:
VWSession, VWLogQuery, VWLogDefinition

Field Summary
static int QUERY_MAX_VALUES_INCLUSIVE
          Integer value of 64. This value is used as a possible value for the queryFlags parameter of the startQuery method.
static int QUERY_MIN_VALUES_INCLUSIVE
          Interger value of 32. This value is used as a possible value for the queryFlags parameter of the startQuery method.
static int QUERY_NO_OPTIONS
          Integer value of 0. This value is used as a possible value for the queryFlags parameter of the startQuery method.
 
Method Summary
 VWLogDefinition fetchLogDefinition()
          Fetches the log definition.
 java.lang.String getName()
          Returns the name of the VWLog, as it is stored int the workflow database.
 VWSession getServiceSession()
          Gets the session that contains the query object.
 void setBufferSize(int theNewSize)
          Sets the maximum number of elements to return in a fetch.
 VWLogQuery startQuery(java.lang.String indexName, java.lang.Object[] minValues, java.lang.Object[] maxValues, int queryFlags, java.lang.String filter, java.lang.Object[] substitutionVars)
          Fetches log items based on conditions specified in the parameters.
 java.lang.String toString()
          Gets the string version of the log 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
Integer value of 0. This value is used as a possible value for the queryFlags parameter of the startQuery method. The value sets all query flag options to false. Returned work objects are unlocked, unbound, and writable.

QUERY_MIN_VALUES_INCLUSIVE

public static final int QUERY_MIN_VALUES_INCLUSIVE
Interger value of 32. This value is used as a possible value for the queryFlags parameter of the startQuery method. The specified value enables using minimum acceptable values for a range of values. Minimum values are evaluated as greater than or equal to rather than the default greater than evaluation.

QUERY_MAX_VALUES_INCLUSIVE

public static final int QUERY_MAX_VALUES_INCLUSIVE
Integer value of 64. This value is used as a possible value for the queryFlags parameter of the startQuery method. The specified value enables using maximum acceptable values for a range of values. Maximum values are evaluated as less than or equal to rather than the default less than evaluation.
Method Detail

startQuery

public VWLogQuery 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
Fetches log items based on conditions specified in the parameters.

The query bases log item retrieval on a filter condition and a range you specify in an index key with Composer. Use a logical AND to include minimum and maximum (minValue and maxValue) index key values, query options (queryFlags), and filters with substitution variables (substitutionVars). Returned log query items match all fetch criteria specified in the parameters. See the Panagon eProcess Developer's Guide for more information on querying.

Parameters:
indexName - The name of an authored database index key for the log element items.

System indexes include:

      F_LogTime = F_TimeStamp + F_SeqNumber
      F_LogWobTag = F_WorkObjectTag + F_TimeStamp + F_SeqNumber
 

minValues - An array of minimum values used to compare index key fields.

The array elements type must match the type of the fields in the index key. If the number of minValues array elements is smaller than the number of index key fields, the system assumes the fields at the end of the index key have no value. The array element must be of a Java type that corresponds to a Process system type. For example, java.lang.Integer corresponds to the Process system integer.

Example:

     myIndex = integerA + stringB + booleanC;
     Object[] minValues = {new Integer(1000), "aardvark", new Boolean(true)};
 

maxValues - An array of maximum values used to compare the index key fields.

The array elements type must match the type of the fields in the index key. If the number of maxValues array elements is smaller than the number of index key fields, the system assumes the fields at the end of the index key have no value. The array element must be of a Java type that corresponds to a Process system type. For example, java.lang.Integer corresponds to the Process system integer.
 

queryFlags - Integer value flags that specify the query options.

Setting this parameter refines the query for the Log Records specified by the index. You can use the + (additive plus) operators to combine these options.

Valid query options are:

  • 0: QUERY_NO_OPTIONS
  • 32: QUERY_MIN_VALUE_INCLUSIVE
  • 64: QUERY_MAX_VALUE_INCLUSIVE

filter - A string containing a valid SQL statement used as a filter condition for the query.

When used with the values specified in the minValues, maxValues, and queryFlags parameters, you can refine a query. The parameter must contain a SQL WHERE clause that places a field name of the left side of a Boolean operator and a value on the right side of the same operator. In accordance with SQL expression rules, The fields in the filter expression must begin with a colon (":").

You can substitute the variable fields with the substitutionVars parameter. A log element field that is not a variable must be system- or user-defined. For example, for log element fields, integerA and stringB can be used to write the expression:

      integerA < :A AND stringB = :B
 
Note that substitution variable names are arbitrary and order-dependent. Order alone determines which values in the substitutionVars parameter are substituted into which variables. This means that if every substitution variable were given the same name, the result would be no different than if the names were all unique--only their order maps the substitution variables to their values.

substitutionVars - An array of variable name substitutes for the items in the filter parameter SQL expression.

Variables 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 the parameter substitute for the corresponding array elements in the filter parameter array. The filter parameter array elements are ordered placeholders, into which you must substitute a variable. For example, if three names are :A, a user needs three distinct substitution variables.

Example:
The following example is based on the example for the filter parameter:

      {new Integer(1000),"Smith"}]
 
Note that the array would be substituted for the first variable, :A, contained in the filter expression. Similarly,"Smith" would be substituted for the second substitution variable, :B.

Returns:
A VWLogQuery instance from which the query fetches items.
Throws:
VWException - The method throws an exception if it cannot complete the process of fetching log items.

getServiceSession

public VWSession getServiceSession()
Gets the session that contains the query object.
Returns:
A VWSession object. The returned VWSession object is the object that instantiated the VWLog object.

toString

public java.lang.String toString()
Gets the string version of the log name.
Overrides:
toString in class java.lang.Object
Returns:
The localized log name.

setBufferSize

public void setBufferSize(int theNewSize)
                   throws VWException
Sets the maximum number of elements to return in a fetch. The default number is 50.
Parameters:
newSize - An integer value that specifies the number of elements to return in a fetch. The value must be greater than 0 (zero).
Throws:
VWException - The method throws an exception if buffer size is less than or equal to 0 (zero).

fetchLogDefinition

public VWLogDefinition fetchLogDefinition()
                                   throws VWException
Fetches the log definition.
Returns:
A VWLogDefinition object.
Throws:
VWException - The method throws an exception if it cannot complete the process of fetching the log definition.

getName

public java.lang.String getName()
Returns the name of the VWLog, as it is stored int the workflow database.
Returns:
The name of the database.

Process Class Relationships

Copyright © 2002 FileNET Corporation. All rights reserved.