The Callback Rule Function Required Signature

The callback function must have a signature with the parameter types provided in a specific order.

The following table lists the parameter types in the order of their usage:

Parameter Notes
String id Identifies the current execution. Uses the value of listenerName, which was provided when calling the Query.Statement.executeWithCallback() function. The ID enables you to identify rows of data belonging to different executions of the same query (or different queries).
boolean isBatchEnd Used in the case of continuous queries only, and is useful only when the query text contains an order by clause (see Order by Clause).

Only true at the end of a batch of rows of data generated by the query.

In the case of continuous queries where no sorting is used, each row of data is a batch.

See Example Showing Batching of Return Values (Continuous Queries).

boolean hasEnded When true, signals the end of the execution.
Object row

OR

Object rows
For Query.Statement.executeWithCallback(): An array of columns representing one row of data generated by the query. Each column corresponds to an item in the projection (see Select Clause).

For Query.Statement.executeWithBatchCallback(): an array of rows comprising one batch of results.

Object closure Closure object provided when executing the Query.Statement.executeWithCallback() function, or null.

The object provided depends on your needs. For example, it could be a simple string, or it could be an array of objects used to add a row of data from each callback rule function.