When you use the Query.Statement.executeWithCallback() function, the agent calls the specified callback rule function once for each row of data generated. The row of data is provided as an array of columns.
● Once, when there are no more results, indicating the end of the results (snapshot queries) or that the statement was closed or the query deleted (continuous queries). See Closing a Statement and Deleting a Query Definition.You can provide a closure object when executing the statement. The closure object is provided to each rule function call. It can contain anything useful in the execution context. For example, you can use an object array to accumulate each row of results returned in each callback rule function call.The callback function must have a signature with the following parameter types, provided in the order specified:
String id Identifies the current execution. Uses the value of ExecutionName, 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. boolean hasEnded Object row 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). Object closure Closure object provided when executing the 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.
Copyright © TIBCO Software Inc. All Rights Reserved.