[rules-users] Drools all lhs execute before all the rhs, i want to run sequentially

Wolfgang Laun wolfgang.laun at gmail.com
Mon Sep 26 02:42:49 EDT 2011


It seems to me that you should write this as a plain old if/then/else/if...
in Java (or any other language). Or is there something else in the way
Drools evaluates rules over facts in working memory that makes it highly
desirable to use rules?

This has been asked before, and more often than not there was a way to avoid
a way of establishing the sequence of RHS execution by salience or whatever.


So, if you do need rules, you can assign decreasing salience values to all
your rules. To terminate, either call the engine's halt() method, or retract
the fact(s) triggering the rules. But note that all conditions will be
evaluated before the first RHS is executed. To aoid this: see the 1st
sentence.

-W


On 26 September 2011 06:54, Saurabh Pandey <meet.saurabhpandey at gmail.com>wrote:

> In drools rules, all the LHS ie when conditions are executed at the start,
> then all there subsequent rhs ie then part executes, In my project i want
> to
> run it as a  simple if-else i.e
> When ... Then do.....
> When ... Then do......
> if this "when" is false then only go to the next when, and if its true then
> execute its "then" and then move ahead to the other "when".
> i tried agenda-group, activation-group but these are not working for me.
> Can some one plz help me!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-all-lhs-execute-before-all-the-rhs-i-want-to-run-sequentially-tp3368215p3368215.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110926/63a767ce/attachment.html 


More information about the rules-users mailing list