Filter options for query tables

When you run a query on a query table in Business Process Choreographer, filter options can be passed as input parameters to the methods of the query table API.

An instance of the com.ibm.bpe.api.FilterOptions class if the Business Flow Manager Enterprise JavaBeans is used, or an instance of the com.ibm.task.api.FilterOptions if the Human Task Manager Enterprise JavaBeans is used, can be passed to the query table API. The filter options allow a configuration of the query using:
  • A threshold and offset (skipCount)
  • Sort attributes (similar to the ORDER BY clause in an SQL query)
  • A user-provided query filter
  • The set of attributes returned, including work item information
  • Other

The result set that can be obtained from a query table is specified by the definition of the query table. However, you might want to specify additional options when the query is run. The following table describes the options that can be specified as filter options using the FilterOptions object.

Table 1. Query table API parameters: Filter options
Option Type Description
Selected attributes java.lang.String
  • A comma separated list of attributes of the query table that must be returned in the result set.
  • If instance-based authorization is used, work item information can be retrieved by specifying attributes of the WORK_ITEM query table, prefixed with WI., for example, WI.REASON.
  • If null is specified, all attributes of the query table are returned, without work item information.
Sort attributes java.lang.String A comma separated list of attributes of the query table, optionally followed by ASC for ascending or DESC for descending.

This list is similar to the SQL ORDER BY clause: sortAttributes ::= attribute [ASC|DESC] [, sortAttributes]. If ASC or DESC is not specified, ASC is assumed. Sorting occurs in the sequence of the sort attributes. This example sorts tasks in query table TASK in descending order by state, and within the groups of the same STATE by NAME, in ascending order: "STATE DESC, NAME ASC".

Threshold java.lang.Integer Defines the maximum:
  • Number of rows returned if queryRows is used.
  • Number of entities returned if queryEntities is used. The actual number of available entities in the query table may exceed the threshold number of entities for the query even if the entity result set does not contain as many entities as the threshold number. This is due to technical reasons if work item information is selected.
  • Count returned if queryRowCount or queryEntityCount is used.
The default is null which means that no threshold is set.
Skip count java.lang.Integer Defines the number of rows (row-based queries) or the number of entities (entity-based queries) that are skipped. As with the threshold parameter, skipCount may not be accurate for entity-based queries.

Skip count is used to allow paging over a large result set. The default is null which means that no skipCount is set.

Time zone java.util.TimeZone The time zone that is used when converting timestamps. An example is CREATED on the predefined query table TASK. If not specified (null), the time zone on the server is used.
Locale java.util.Locale The locale which is used to calculate the value of the $LOCALE system parameter. An example usage of $LOCALE in a selection criterion is: 'LOCALE=$LOCALE'.
Distinct rows java.lang.Boolean Used for row-based queries only. If set to true, row-based queries return distinct rows. This does not imply that unique rows are returned due to the possible multiplicity of work item information.
Query condition java.lang.String This option performs additional filtering on the result set. All of the attributes that are defined for the query table can be referenced. If authorization is required for the query table, columns that are defined for the WORK_ITEM query table can also be referenced using the WI prefix, for example, WI.REASON=REASON_POTENTIAL_OWNER.