The example provided in this section shows how a callback rule function is used to gather results generated by the query. The callback rule function is shown next:
Query.create("report853", "select agent_name, total_sales, zipcode from /Concepts/Sales");
Where requestEvent is an event, and "/MyRF" is the path to the rule function shown at the beginning of the section. The true parameter indicates that this is a continuous query.In the sample output below, each row of data (generated when a relevant change occurs in the cache) is one batch, because the query does not involve ordering or aggregation. The last line below indicates that the query has ended. For example, someone closed the statement (not shown in the code sample).
As a reminder: the first Boolean indicates whether the batch has ended or not; the second Boolean indicates whether the execution has ended or not.This example is the same as the example above, with the addition of an order by clause in the query text, to show batching behavior. Only the output and function calls differ.
Query.create("report853", "select agent_name, total_sales, zipcode from /Concepts/Sales order by agent_name");
As a reminder: the first Boolean indicates whether the batch has ended or not; the second Boolean indicates whether the execution has ended or not.
Copyright © TIBCO Software Inc. All Rights Reserved.