This topic applies only to the IBM Business Process Manager Advanced configuration.

Example: Querying escalations

This example shows how to use the query method to retrieve escalations for the logged-on user.

When a task is escalated, and escalation receiver work item is created. The user, Mary Jones wants to see a list of tasks that have been escalated to her. The following code snippet shows the query method call for the query:
query( "DISTINCT ESCALATION.ESIID, ESCALATION.TKIID", 
         "WORK_ITEM.REASON = WORK_ITEM.REASON.REASON_ESCALATION_RECEIVER",  
           (String)null, (String)null, (Integer)null, (TimeZone)null )
The following actions are taken when the SQL SELECT statement is generated:
  • A condition for access control is added to the where clause. This example assumes that group work items are not enabled.
  • Constants, such as TASK.STATE.STATE_READY, are replaced by their numeric values.
  • A FROM clause and join conditions are added.
The following code snippet shows the SQL statement that is generated from the API query:
 SELECT DISTINCT ESCALATION.ESIID, ESCALATION.TKIID
   FROM   ESCALATION ESC, WORK_ITEM WI 
   WHERE  ESC.ESIID = WI.OBJECT_ID
   AND    WI.REASON  = 10                                 
   AND  
  ( WI.OWNER_ID = 'MaryJones' OR WI.OWNER_ID = null AND  WI.EVERYBODY = true )