Databases Reference
In-Depth Information
Within the context of this text, a Decision Service and a Decision
Function is essentially the same thing. Within the rule editor, we define
a Decision Function ; we then expose that function as a web service,
which can then be invoked within a composite as a Decision Service .
Asserting facts
The first step is for the decision function to assert all the facts passed by the client
into the working memory of the rules sessions, ready for evaluation by the rule
engine. Once the facts have been asserted into working memory, the next step is
to execute the ruleset.
Executing the ruleset
Recall that a ruleset consists of one or more rules and that each rule consists of two
parts; a rule condition, which is composed of a series of one or more tests, and an
action block or list of actions to be carried out when the rule condition evaluates to
true for a particular fact or combination of facts.
It's important to understand that the execution of the rule condition and its
corresponding action block are carried out at two very distinct phases within
the execution of the ruleset.
Rule activation
During the first phase, the rule engine will test the rule condition of all rules to
determine for which facts or combination of facts the rule conditions evaluate to
true. A group of facts that together cause a given rule condition to evaluate to true is
known as a fact set row . A fact set is a collection of all fact set rows that evaluate to true
for a given rule.
In many ways it's similar in concept to executing the rule condition as a query over
the facts in working memory; with every row returned by the query equivalent to a
fact set row, and the entire resultset being equivalent to the fact set.
For each fact set row, the rules engine will activate the rule. This involves adding each
fact set row with a reference to the corresponding rule to the agenda of rules which
need to be fired. At this point, the action block of any rule has not been executed.
When rule activations are placed on the rule agenda, they are ordered based on
the priority of the rule, with those rules with a higher priority placed at the top
of the agenda.
 
Search WWH ::




Custom Search