Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Example Showing Batching of Return Values (Continuous Queries)

The example is the same as the simple continuous query example, with the addition of an `order by` clause in the query text, to show batching behavior. Only the output and function calls differ.

## Create the Query

    Query.create("report853", "select agent_name, total_sales, zipcode from /Concepts/Sales order by agent_name");

## Sample Output

- `Mary Smith makes a sale``.`

      C123: Agent Mary Smith sold $15063.28 in 94304. @@@@
      C123: --------

- `Time passes… Robert Ng makes a sale``.`

      C123: Agent Mary Smith sold $15063.28 in 94304. @@@@
      C123: Agent Robert Ng sold $14983.05 in 94304. @@@@
      C123: --------

- `Time passes… Jose Ortiz makes a sale``.`

      C123: Agent Jose Ortiz sold $16244.78 in 94304. @@@@
      C123: Agent Mary Smith sold $15063.28 in 94304. @@@@
      C123: Agent Robert Ng sold $14983.05 in 94304. @@@@
      C123: --------
      C123: ========

## Function Calls

The following example shows the parameter values for each function call.

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.

    Mary Smith makes a sale.
    MyRF(clbk, false, false, ["Mary Smith", 15063.28, 94304], "@@@@")
    MyRF(clbk, true, false, null, "@@@@")
    Time passes… Robert Ng makes a sale.
    MyRF(clbk, false, false, ["Mary Smith", 15063.28, 94304], "@@@@")
    MyRF(clbk, false, false, ["Robert Ng", 14983.05, 94304], "@@@@")
    MyRF(clbk, true, false, null, "@@@@")
    Time passes… Jose Ortiz makes a sale.
    MyRF(clbk, false, false, ["Jose Ortiz", 16244.78, 94304], "@@@@")
    MyRF(clbk, false, false, ["Mary Smith", 15063.28, 94304], "@@@@")
    MyRF(clbk, false, false, ["Robert Ng", 14983.05, 94304], "@@@@")
    MyRF(clbk, true, false, null, "@@@@")
    MyRF(clbk, true, true, null, "@@@@")

Note: The `Query.Statement.executeWithBatch Callback()` function works in a similar way, except that the callback rule function is called once for each batch, and the results are sent as an array of rows.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.