Finding Case Objects by Criteria

From within a script, use the findByCriteria method to return a list of case references that match the criteria defined in a query string.

The query must be expressed in Data Query Language (DQL).

Method syntax Description
findByCriteria (DQLString, caseType, index, pageSize) Returns a paginated list of case references that match the criteria specified in the DQLString.

where:

  • DQLString is the query to be executed. See Case Data Query Language (DQL).
  • caseType is the parent ID followed by the case class name. For example,

    'com.example.carapplication.Customer'.

  • index is the (zero-based) number of the first record to return in a paginated list.
  • pageSize is the number of records to return in each page of a paginated list. A value of -1 means return all records.

Examples

The following example shows how to use a query string.

	// Find orders from customers whose name begins with “EasyAs” (returning references to the first 20).
	var ordRefs = bpm.caseData.findByCriteria("customer.name='EasyAs'", 'com.example.ordermodel.Customer', 0, 20);