[rules-users] DRL logic failing

Matthew Runo mruno at zappos.com
Fri Mar 26 14:34:46 EDT 2010


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





More information about the rules-users mailing list