Use the query method or the queryAll method of the service API to retrieve stored information about business processes and tasks.
The query method returns objects according to the caller's authorization. The query result set contains the properties of only those objects for which the caller has an associated work item. The queryAll method returns the selected data for all of the objects in the database.
Predefined database views are provided for you to query the object properties.
The query is made up of the following elements:
The syntax of the query depends on the object type. The following table shows the syntax for each of the different object types.
Object | Syntax |
---|---|
Process template | ProcessTemplateData[] queryProcessTemplates (java.lang.String whereClause, java.lang.String orderByClause, java.lang.Integer threshold, java.util.TimeZone timezone); |
Task template | TaskTemplate[] queryTaskTemplates (java.lang.String whereClause, java.lang.String orderByClause, java.lang.Integer threshold, java.util.TimeZone timezone); |
Business-process and task-related data | QueryResultSet query (java.lang.String selectClause, java.lang.String whereClause, java.lang.String orderByClause, java.lang.Integer skipTuples java.lang.Integer threshold, java.util.TimeZone timezone); |
QueryResultSet result = process.query("DISTINCT WORK_ITEM.WIID", (String)null, (String)null, (Integer)null, (Integer)null, (TimeZone)null);
The query interface also contains a queryAll method. You can use this method to retrieve the data for all of the objects that are stored in the database, for example, for monitoring purposes. The caller of the queryAll method must have one of the following Java 2 Platform, Enterprise Edition (J2EE) roles: BPESystemAdministrator, BPESystemMonitor, TaskSystemAdministrator, or TaskSystemMonitor. Authorization checking using the corresponding work item of the object is not applied.
You can include both custom properties and variable properties in queries. If you include several custom properties or variable properties in your query, this results in self-joins on the corresponding database table. Depending on your database system, these query() calls might have performance implications.
You can also store queries in the Business Process Choreographer database using the createStoredQuery method. You provide the query criteria when you define the stored query. The criteria are applied dynamically when the stored query runs, that is, the data is assembled at runtime. If the stored query contains parameters, these are also resolved when the query runs.
For more information on the Business Process Choreographer APIs, see the Javadoc in the com.ibm.bpe.api package for process-related methods and in the com.ibm.task.api package for task-related methods.
Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)