No, lock-on-active is not required since the LHS tests for the field value1 being false. You can verify easily (just add a high-salience rule that inserts one ObjectOneTwo) that the full code works correctly, as posted. So, this is not the code that "causes the problem".
What else might happen? There could be more than one ObjectOneTwo, so the first rule might fire again with another one of these. Or some other rule resets value1 of the (single) ObjectOneTwo. Or the object is retracted and inserted anew.
Posting of code that does not reproduce the problem isn't helpful either.
-W
so lock-on-active will help.. you should add that in both rulesrule "one"lock-on-activethen...whenend--On Mon, Sep 19, 2011 at 3:05 PM, skasab2s <skasab2s@smail.inf.fh-brs.de> wrote:Thanks for the reply. This is the full code:
$objectOneTwo : ObjectOneTwo (value1 == false)
/declare ObjectOneTwo
value1 : boolean
value2 : boolean
end
rule "first rule"
when
then
$objectOneTwo.setValue1(true);
update($objectOneTwo);
end$objectOneTwo : ObjectOneTwo (value2 == false)
rule "second rule"
when
then
$objectOneTwo.setValue2(true);
update($objectOneTwo); //<-- this is where "first rule" fires once
again (not desired for me and that's the problem)
end
/
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Multiple-variables-problem-tp3349281p3349377.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com- Co-Founder @ http://www.jugargentina.org
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users