Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# 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.

Note: 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`.

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.

Subtopics

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.