Because I need the precision of a double , for example :<br><br>if totalAmount = 150.3<br><br>1) t : Bill($amount : totalAmount, totalAmount < 150.0);<br><br>=> the rule will be fired (and should not be)<br><br>2) t : Bill($amount : totalAmount, totalAmount < (new<br>
< Double(150.0).doubleValue()));<br><br>=> the condition will be not be satisfied<br><br>I solve my first problem.<br><br><br><br><div class="gmail_quote">2009/3/16 Greg Barton <span dir="ltr"><<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Not addressing your stated problem, but I have one question: why are you using this expression: "new Double(150.0).doubleValue()"<br>
<br>
Why not just use "150.0"?<br>
<br>
--- On Mon, 3/16/09, thomas moncieu <<a href="mailto:thomas.moncieu@gmail.com">thomas.moncieu@gmail.com</a>> wrote:<br>
<br>
> From: thomas moncieu <<a href="mailto:thomas.moncieu@gmail.com">thomas.moncieu@gmail.com</a>><br>
> Subject: Re: [rules-users] Problem with updated facts<br>
> To: "Rules Users List" <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
> Date: Monday, March 16, 2009, 9:39 AM<br>
<div><div></div><div class="h5">> Hi, these are the rules :<br>
><br>
> Rule A :<br>
><br>
> rule "ID_15202"<br>
> ruleflow-group "RG_A"<br>
> when<br>
> i : Item(name=="cheese")<br>
> t : Bill(anItem==i);<br>
> then<br>
> t.setAmount(t.getAmount() - 100);<br>
> update(t);<br>
> end<br>
><br>
> Rule B:<br>
><br>
> rule "ID_15203"<br>
> ruleflow-group "RG_T"<br>
> when<br>
> t : Bill($amount : totalAmount, totalAmount > (new<br>
> Double(150.0).doubleValue()));<br>
> then<br>
> System.out.println("tot : " + $tot);<br>
> end<br>
><br>
> It gives the correct result if shadow proxy is turned on.<br>
><br>
> But all the rules are re-evaluated with the update(t). Is<br>
> there another way<br>
> that no-loop or lock-on-active that prevents from<br>
> re-evaluating all the<br>
> rules ?<br>
><br>
> Thanks for your interest<br>
><br>
> 2009/3/12 surya_n2007 <<a href="mailto:surya_n2007@yahoo.co.in">surya_n2007@yahoo.co.in</a>><br>
><br>
> ><br>
> > Please post the complete rule where you are updating<br>
> fact.<br>
> > --<br>
> > View this message in context:<br>
> ><br>
> <a href="http://www.nabble.com/Problem-with-updated-facts-tp22458416p22477032.html" target="_blank">http://www.nabble.com/Problem-with-updated-facts-tp22458416p22477032.html</a><br>
> > Sent from the drools - user mailing list archive at<br>
> Nabble.com.<br>
> ><br>
> > _______________________________________________<br>
> > rules-users mailing list<br>
> > <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
> ><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>