[rules-users] DRL logic failing

Edson Tirelli ed.tirelli at gmail.com
Fri Mar 26 17:20:43 EDT 2010


   Sounds like a bug in the pattern offset calculation... :/

   Can you open a JIRA for that with your test case plz?

   Meanwhile, you can try a work around by removing that "or" between evals
and inlining them... not sure it will work, but I guess it is worth a try...

   order : WrappedOrder( eval(hasPromotionX(order.getPromotions())) );
   address : Address( eval(matchAddress(address.getAddress1()) ||
matchAddress(address.getAddress2())) ) from order.getShippingAddress();

   Edson

2010/3/26 Matthew Runo <mruno at zappos.com>

> Hello folks -
>
> I'm having the strangest issue. First off, here's my DRL logic..
>
> rule 'Sample Rule One'
> auto-focus true
> dialect 'mvel'
> salience 900
> agenda-group 'Test Rules'
> when
>    order : WrappedOrder();
>    eval(hasPromotionX(order.getPromotions()));
>    address : Address() from order.getShippingAddress();
>    eval(matchAddress(address.getAddress1())) OR
>    eval(matchAddress(address.getAddress2()));
> then
>    # If we're here, it's got the promotion and address match...
>    do.something....
>    drools.halt();
> end
>
> The problem is that drools is looking for getAddress1() and getAddress2()
> on "order" - not "address". And, of course, that fails - a WrappedOrder does
> not have those methods - an Address() does!
>
> Any ideas?
>
> Thanks for your time!
>
> Matthew Runo
> Software Engineer, Zappos.com
> mruno at zappos.com - 702-943-7833
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100326/c8b19665/attachment.html 


More information about the rules-users mailing list