Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Examples

For example, suppose that two rules declare CustName and SupportLevel. You assign the same rule function to both rules. The function returns 3.0 for Gold support level, 2.0 for Silver, and 1.0 for Bronze. As a result, among the rule tuples with priority 1, those for customers with Gold support run before those for customers with Silver support, which run before those for customers with Bronze support.

Below is an example showing how rule priority and ranking determine the sort order. Suppose you assign the same rule function for ranking rules 1, 2, and 3. At run time these are some rule tuples to be sorted in the agenda for an RTC:

Rule | Priority | Rank
--- | --- | ---
Rule 1 (Tuple X) | Priority: 5 | Rank: 10.0
Rule 2 (Tuple A, B) | Priority: 1 | Rank: 1.0
Rule 2 (Tuple A, C) | Priority: 1 | Rank: -1.0
Rule 2 (Tuple A, D) | Priority: 1 | Rank: -2.0
Rule 3 (Tuple A) | Priority: 4 | Rank: 0.0

They are sorted and run as follows. (This could change during a conflict resolution cycle depending on the effect of rule actions.)

Rule | Priority | Rank
--- | --- | ---
Rule 2 (Tuple A, B) | Priority: 1 | Rank: 1.0
Rule 2 (Tuple A, C) | Priority: 1 | Rank: -1.0
Rule 2 (Tuple A, D) | Priority: 1 | Rank: -2.0
Rule 3 (Tuple A) | Priority: 4 | Rank: 0.0
Rule 1 (Tuple X) | Priority: 5 | Rank: 10.0

## Reverse Order Example

If you want the rule with the smallest return value to be ranked highest, multiply by negative one (-1.0) to reverse the size of the values. For example, suppose you want rules that were asserted earlier to run before those that were asserted later. The time values returned by the three rules are 100, 150, and 300. Using -1.0 * `time`), they are fired in the desired order: -100.0 (the largest value), then -150.0, then -300.0.

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.