Finding a Case Object by its Case Identifier

From within a script, use the findByCaseIdentifier method to return the case reference to the case object that matches the specified case identifier value(s).

Method syntax Description
findByCaseIdentifier(caseId, caseType) Returns the case reference to the case object that matches the specified caseId case identifier value of type caseType.

where:

  • caseId is the case identifier of the case object.
  • caseType is the parent ID followed by the case class name. For example, 'com.example.carapplication.Customer'.

The method returns null if there is no case object that matches the specified caseId value(s).

Example

This example finds a customer's ID using the value in a custID field, which is assumed to have been populated earlier in the process (for example, by a customer service representative filling in a form when the customer telephones).

	// Get the case reference to the Customer class that matches the identifier provided in the customerID field.
	data.customerRef = bpm.caseData.findByCaseIdentifier(data.customerID,'com.example.carapplication.Customer');

	// You can now read the reference to get the corresponding Customer case data object.
	data.customer = bpm.caseData.read(data.customerRef);