[rules-users] Problem with updated facts

thomas moncieu thomas.moncieu at gmail.com
Tue Mar 17 09:44:32 EDT 2009


Because I need the precision of a double , for example :

if totalAmount = 150.3

1) t : Bill($amount : totalAmount,  totalAmount < 150.0);

=> the rule will be fired (and should not be)

2) t : Bill($amount : totalAmount,  totalAmount < (new
< Double(150.0).doubleValue()));

=> the condition will be not be satisfied

I solve my first problem.



2009/3/16 Greg Barton <greg_barton at yahoo.com>

>
> Not addressing your stated problem, but I have one question: why are you
> using this expression:  "new Double(150.0).doubleValue()"
>
> Why not just use "150.0"?
>
> --- On Mon, 3/16/09, thomas moncieu <thomas.moncieu at gmail.com> wrote:
>
> > From: thomas moncieu <thomas.moncieu at gmail.com>
> > Subject: Re: [rules-users] Problem with updated facts
> > To: "Rules Users List" <rules-users at lists.jboss.org>
> > Date: Monday, March 16, 2009, 9:39 AM
> > Hi, these are the rules :
> >
> > Rule A :
> >
> > rule "ID_15202"
> > ruleflow-group "RG_A"
> > when
> > i : Item(name=="cheese")
> > t : Bill(anItem==i);
> > then
> > t.setAmount(t.getAmount() - 100);
> > update(t);
> > end
> >
> > Rule B:
> >
> > rule "ID_15203"
> > ruleflow-group "RG_T"
> > when
> > t : Bill($amount : totalAmount,  totalAmount > (new
> > Double(150.0).doubleValue()));
> > then
> > System.out.println("tot : " + $tot);
> > end
> >
> > It gives the correct result if shadow proxy is turned on.
> >
> > But all the rules are re-evaluated with the update(t). Is
> > there another way
> > that no-loop or lock-on-active that prevents from
> > re-evaluating all the
> > rules  ?
> >
> > Thanks for your interest
> >
> > 2009/3/12 surya_n2007 <surya_n2007 at yahoo.co.in>
> >
> > >
> > > Please post the complete rule where you are updating
> > fact.
> > > --
> > > View this message in context:
> > >
> >
> http://www.nabble.com/Problem-with-updated-facts-tp22458416p22477032.html
> > > Sent from the drools - user mailing list archive at
> > Nabble.com.
> > >
> > > _______________________________________________
> > > rules-users mailing list
> > > rules-users at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> 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/20090317/e610fa56/attachment.html 


More information about the rules-users mailing list