Functions

This topic describes the functions that can be used in query filters.

Event Collector has some functions that can be used with the operand operator filter expression syntax. See Filter Expression Format.

There are three types of functions:
  • Functions that return data for commonly used search criteria.
  • Functions that return audit trails for common objects, for example, cases, work items or process instances.
  • Functions that return comments stored against objects, for example, cases, work items or process instances.

Functions for Common Search Criteria

The format of a function described in the table below is:
function(attribute)
where:
  • function: one of the functions described in the table below.
  • attribute: identifies the type of information to be retrieved. The type of object (for example, process instance or work item) defines the Event Collector table against which the query will execute. The attribute you include with the function depends on the type of object you are interested in. See Using Attributes in Query Language.
Function Description
isSet(attribute) Returns all events for the named attribute that has a value of NULL in the Event Collector audit table you are querying. This is useful for data that are returned even if the objects are deleted. For example, case objects as audit events linked to case objects are returned even if the case objects are deleted.
currentDay(attribute) Returns all events for the named attribute that has a value in the Event Collector audit table you are querying occurring today. Attribute must be of DateTime type.
currentWeek (attribute) Returns all events for the named attribute that has a value in the Event Collector audit table you are querying occurring this week. Attribute must be of DateTime type.
currentMonth(attribute) Returns all events for the named attribute that has a value in the Event Collector audit table you are querying occurring this month. Attribute must be of DateTime type.
currentYear(attribute) Returns all events for the named attribute that has a value in the Event Collector audit table you are querying occurring this year. Attribute must be of DateTime type.
currentUser(attribute) Returns all events for the named attribute that has a value in the Event Collector audit table you are querying for the currently authenticated user.

Functions for Common Objects

Function Description
processInstance(instanceId, details) Returns the audit trail for the specified process instance where:
workItem(workItemId, details)
Returns the audit trail for the specified work item where:
  • workItemId: identifies the work item ID whose events you want to audit. Can be obtained from getWorkListItems.
  • details: Not supported. Pass as an empty string.
caseReference(caseRef, details) Returns the audit trail for the specified case object where:
  • caseRef: The reference to the case object. You can obtain case references using findAllCases.
  • details: Not supported. Pass as an empty string.
caseDetails(caseClass, modelMajorVersion, objectId, details)
Returns the audit trail for the specified case object where:
  • caseClass: The fully qualified name of the case class. For example, com.example.gddemo.Car. You can obtain class names by using getCaseClassInfo.
  • modelMajorVersion: The version number of the case model. For example, 2 or 2.0.0.
  • objectId: The case model ID. For example, 1.
  • details: Not supported. Pass as an empty string.

Functions for Comments

Function Description
processInstanceComments(instanceId) Returns all comments stored against the specified process instance where instanceId identifies the process instance ID whose comments you want to return. instanceId can be obtained from listProcessInstances, queryProcessInstances or queryProcessInstancesAlt.
workItemComments(workItemId) Returns all comments stored against the specified work item where workItemId identifies the work item ID whose comments you want to return. workItemId can be obtained from getWorkListItems.
caseReferenceComments(caseRef) Returns all comments stored against the specified case object where caseRef identifies the reference to the case object. You can obtain case references using findAllCases.
caseDetailsComments(caseClass,modelMajorVersion,objectId)
Returns all comments stored against the specified case object where:
  • caseClass: The fully qualified name of the case class. For example, com.example.gddemo.Car. You can obtain class names by using getCaseClassInfo.
  • modelMajorVersion: The version number of the case model. For example, 2 or 2.0.0.
  • objectId: The case model ID. For example, 1.

Example Queries

processInstanceComments('pvm:0a124') AND currentUser(tibco-admin)

Returns the comments stored against the specified process instance created by the currently authenticated user, in this case, tibco-admin.