To run this sample, use the client application that is delivered with this sample. It is able to display the contents of the query table that you specify. You can specify one of the predefined query tables for displaying the actual for instance data. Instead, you can specify a query table name of your choice; please enter the name in correct case because this is required, and future validators may issure errors on incorrect case (lower case or mixed case characters).
The queries used to get the results can then be customized by specifying a subset of columns, or by specifying a query condition to get a subset of rows.
To start the client application on a WebSphere Process Server, follow these steps:
http://yourhost:yourport/queryTablesSample.Note: Replace yourhost with your server's internet address and replace yourport with the port of your server's HTTP transport,
for example http://localhost:9080/queryTablesSample.
The client application is displayed:


The result of the query is rendered in the same window:

Notes:
In the previous steps, just an empty table was displayed. This was because in this sample, there are no business processes and no human tasks included that could be instantiated. Therefore in the following, business process instance data and human task instance data are created using a different sample. Then we use the current client again to display those instance data.
Follow these steps:
Now you have created instance data that we will display in the following steps.
You can now find the newly created instance data by using the client shipped with this sample.
Follow these steps:
http://yourhost:yourport/queryTablesSample
that resolves to http://localhost:9080/queryTablesSample
when using default settings for hostname and ports.Due to the created task instances, the table is now populated with data, and your screen may look similar to this one (instance data marked yellow):

LOCALE = 'en_US'The constraints entered in the query specification (marked yellow below) are now reflected in both the content section and the source code section. The screen may look similar to this one:

Feel free to try your own queries and even to enforce error situations intentionally by entering invalid columns or query conditions.
Finally, we generate a table that contains process instance data in a format similar to the "Started by me" view of the BPC Explorer.
Follow these steps:
NAME,TEMPLATE_NAME,STATE,STARTED,PARENT_NAME,TOP_LEVEL_NAMESTARTER='admin'The screen may look similar to this one:

Note: In the column STATE, the raw integer value from the database is shown. In contrast, the BPC Explorer translates the raw values from the raw value (for example, 2) into the corresponding symbolic value (for example, Running). The mapping from the raw values to the symbolic values can be found in the documentation PROCESS_INSTANCE view, TASK view, etc. in the Information Center.
For comparison, the corresponding BPC Explorer view looks like this:

In addition to the predefined query tables for instance data, WebSphere Process Server is shipped with predefined query tables
for accessing the actual template data.
Note however that for accessing query tables containing template data, administrator privileges are required.
In other words, you can access the template data only if you log in as a user that is defined in the BPESystemAdministrator J2EE role
(by default, user id admin is such a privileged userid).
Examples for predefined query tables containing template data
are PROCESS_TEMPLATE and TASK_TEMPL.
The complete list of predefined query tables can be found in the Information Center
section Predefined query tables.
To work with those query tables, in the client application shipped with this sample you can select [OTHER]
and enter a query table name of your choice.
As mentioned previously, a Java code snippet for lauching the query is rendered in the client application. Note that this code snippet is just for illustation purposes, thus you may want to use more setter methods and add error handling to produce reliable code. For a more detailed explanation of the source code, refer to the Code Review section of this sample.