Drools 3.0.x never had a sequentail execution mode. What it had was an
attribute in the decision table tht would insert and order the salience
values automatically. The sequential execution mode in 4.0.x is vey
different and it changes the execution semantics of the engine.
"after the initial data set no more data can be asserted or modified (no
rule re-evaluations) and rules cannot be added or removed"
mohit churiyal wrote:
We migrated our project from Drools 3 to Drools 4. We
observed a slight change of behavior in execution of
rules in sequential mode. Suppose we have drl file
with two rules. In first rule we find whether customer
is preferred customer or not and in second rule we use
it to set a discount percentage (portion of drl
provided below). In Drools 3 if we use sequential
execution using rulebase.addPackage(pkg,false) then
both the rules get fired (because first rule updates
customer object). But in Drools 4 if we use sequential
execution (using ruleBaseConf.setSequential(true))
then rule "preferred" gets fired but rule "discount"
doesn't. Apparently the update() in first rule does
not take effect. This is not the behavior one would
expect. Is there any configuration by which same
behavior can be achieved for Drools 4 also? I went
through the user guide and tried few things like
(and SequentialAgenda.SEQUENTIAL too) but nothing
eval(customer.getMonthlySalary() > 5000)
System.out.println("Updated customer type.");
System.out.println("Updated discount percentage.");
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
rules-users mailing list