[rules-users] Multiple variables problem..

Wolfgang Laun wolfgang.laun at gmail.com
Mon Sep 19 13:58:18 EDT 2011


The effect you describe should only happen if you do not modify/update the
ObjectOneTwo in the consequence.

Posting pseudo-code that doesn't show what you really have in your rules
doesn't help.

-W




On 19 September 2011 19:36, skasab2s <skasab2s at smail.inf.fh-brs.de> wrote:

> Hello,
>
> I have a rule file with multiple boolean variables. Currently, I declare a
> new wrapper object for every single variable
>
> /declare Object1
>  value : boolean
> end
>
> declare Object2
>  value : boolean
> end
> /
>
> The approach works fine, but when I try wrapping the two variables in one
> object a not desired effect happens: see code:
>
> /declare ObjectOneTwo
>  value1 : boolean
>  value2 : boolean
> end
>
> rule "first rule"
>  when
>      ObjectOneTwo (value1 == false)
>  then
>      set ObjectOneTwo.value1 to 'true'
>  end
>
> rule "second rule"
>  when
>     ObjectOneTwo (value2 == false)
>  then
>    set ObjectOneTwo.value2 to 'true'  /
>  end
> In the second rule, we modify the same object ObjectOneTwo again which
> causes "fist rule" to fire again although this is not desired. Do you know
> how to avoid this effect and still have one wrapper object for all
> variables?
>
> Thanks in advance!
>
> Svetlomir.
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Multiple-variables-problem-tp3349281p3349281.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/20110919/c86cd85a/attachment.html 


More information about the rules-users mailing list