How to Work with Rules
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.
For example, a rule has this condition:
c.name == "Bob";
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.
As another example, suppose a rule has these conditions:
b.num<10; hasAGoldMembership(c);
where b is another concept type and num is one of its properties. The dependency set for this rule is b.num and c.
How to Test the Truth of a Rule’s Conditions Using the Dependency Set
During a conflict resolution cycle, TIBCO BusinessEvents tests each rule’s dependency set against the new set of facts. If the facts match the rule dependencies, the rule conditions are all true and the rule action is added to the rule action agenda. The structure of the Rete network enables very quick matching between facts and rule dependency sets.
If TIBCO BusinessEvents cannot calculate dependencies on the properties of an entity from the rule condition, for example if you pass an entity to a function, TIBCO BusinessEvents evaluates the rule every time the entity or its properties changes.
How a Rule Becomes Newly True
A rule is true if objects in the rule scope exist in the Rete network and if all of the rule conditions are met by objects in the Rete network. However when building the rule action agenda, TIBCO BusinessEvents examines only rules that are newly true.
A rule is newly true if it has become true due to a change in the Rete network during the current RTC.
In the case of a rule with no conditions, assertion of an object in the scope (declaration) of the rule makes the rule newly true.
A rule that was false and becomes true because of the changes in the Rete network during the RTC is newly true.
A rule remains newly true until it is executed or it is removed from the agenda, or the RTC ends.
A rule is removed from the agenda because a change in the Rete network during an RTC means that the facts no longer satisfy its dependency set, for example because a concept instance is deleted or a concept property changes value.