![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
A run to completion, or RTC, cycle generally begins when an external action causes changes to the Rete network. It ends when there are no more rule actions to execute as a result of that initial change (and any subsequent changes caused by rule actions). This is also known as forward chaining, or inferencing. During one RTC changes can occur in the Rete network, but no new external actions can affect it.Figure 5 Run to Completion CycleOne RTC is composed of one or more conflict resolution cycles. A conflict resolution cycle begins when TIBCO BusinessEvents builds (or refreshes) a rule action agenda, a list of all rules that are eligible to fire. The agenda is used to determine which rule action to execute next. The agenda is built based on the following information:The Rete network changes The first of the conflict resolution cycles is initiated by change in the Rete network, caused by an external action such as a message arriving at a destination.TIBCO BusinessEvents builds the agenda To build the rule action agenda, TIBCO BusinessEvents examines all rules that are newly true because of the change to Rete network and compares them with rule dependencies. The agenda’s entries are ordered according to rule priority, rule rank, and other criteria.TIBCO BusinessEvents executes the first rule on the agenda and removes it from the agenda As a result, one of the following occurs:
TIBCO BusinessEvents Express Content relating to Cache OM and backing store is not relevant to TIBCO BusinessEvents Express edition.TIBCO BusinessEvents refreshes the rule action agenda If a rule action changes the contents of the Rete network, the agenda is refreshed, beginning a new conflict resolution cycle. When the agenda is refreshed, any of the following can occur:An empty agenda ends the RTC At some point, no more actions remain to be executed. The conflict resolution has run to completion. The RTC is over. Now begins the post RTC phase. At various points during this phase the following actions happen (depending on how the project has been configured):
• Cache OM, Cache Only mode: All Cache Only objects are removed from the Rete network. See Loading Cache Only Objects into the Rete Network for important information about working in Cache Only mode.Before any data enters the system, TIBCO BusinessEvents builds the Rete network, which embodies all the rule dependencies, using the rule conditions (if any). All the dependencies in a rule are called its dependency set.Where c is a concept of type /Customer. In this case, the dependency set of the rule contains only the name property of the concept type /Customer.Where b is another concept type and num is one of its properties. The dependency set for this rule is b.num and c.A rule is newly true if it has become true due to a change in the Rete network during the current RTC.
Less obviously, a rule that was already true can also become newly true. For example, a rule may already be true because a condition that specifies a range is satisfied. It becomes newly true if the property value in the Rete network changes but is still within the range. For example, the condition c.b<10; is true if the Rete network includes a c.b with value 9. It is newly true if an action at the end of a conflict resolution cycle changes the value from 9 to 8.
1. Filters, that is, conditions that only involve one scope element (object). Filters are the least expensive operations, in terms of processing cost. For example:
2. Equivalent join conditions, that is, conditions that compare two expressions using == where each expression involves one (different) object from the scope. Equivalent joins take more processing than filters, but less than non-equivalent joins. For example:
3. Non-equivalent join conditions, that is, conditions involving two or more scope elements other than equivalent joins. These are done last because they are the most expensive in terms of processing cost. For example:
Log file warnings—multiple equivalent join conditions If a rule uses multiple equivalent joins, a warning is printed to the engine log file. The purpose of the warning is to draw your attention to the situation so you can ensure that the order of the joins results in the most efficient processing.Optimization To optimize performance, do as much filtering as possible, to reduce the number of times TIBCO BusinessEvents evaluates a join condition.Be aware of some differences in execution when you combine conditions. For example, consider the following separate conditions. A null pointer exception might be thrown if concept.containedConcept is null, if the second condition was checked before the first:
In this case, a null pointer exception is not thrown when concept.containedConcept is null because it is always checked first.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |