Rules and Functions : Rules

Rules
Most rules in BusinessEvents are used for inferencing. However, regular business rules also have a role to play.
Inferencing Rules
Inferencing rules are at the heart of BusinessEvents. Inferencing rules are declarative, and at runtime are executed based on the outcome of each conflict resolution cycle (see Understanding Conflict Resolution and Run to Completion Cycles.)
A rule includes the following parts:
Statements in a rule action might create or modify concept instances, create and send simple events, call functions and rule functions, and so on depending on need.
Rule Priority and Rank
For each RTC, the rule agenda is sorted by priority and then within priority by rank, for those rules that use the same ranking mechanism. Use of priority and rank is optional. You can also use priority without using rank.
TIBCO recommends that you use priority and rank features only as needed; that is, unless there is reason to set priority (or priority and rank), let the rule engine determine the sequence of execution. This lessens the complexity of rule maintenance, and takes advantage of the power of the inferencing engine.
Rule Priority
Because BusinessEvents rules are declarative rather than procedural, there is no inherent order for processing. However, a priority property allows you to specify the order in which rules in one RTC execute.
Rule Rank Within the Same Priority
If you want to also control the order in which rules with the same priority execute, you can use the rule rank feature. The value for the Rank property is a rule function that returns a double. The larger the return value, the higher the ranking. You can specify the same rule function in different rules to perform ranking across tuples of those rules.
Other Rules
Not all rules in BusinessEvents are inferencing rules. Rules in decision tables are business rules, executed only when the table is invoked.
Organizing and Deploying Inferencing Rules
You can organize rules depending on your project and project maintenance needs. Rules are organized in folders. At deploy time you can select folders of rules or individual rules (or both) for deployment.