Discount is a field of Order and must not appear in an Item(...).<br>Probably you want:<br> Order ( $discount : Discount > 10,...<br><br>Also, most likely, all your fields need to be written with a lower case initial letter,<br>
Order ( $discount : discount > 10, $items : items)<br><br>-W<br><br><div class="gmail_quote">On Tue, Feb 23, 2010 at 1:11 PM, dhari <span dir="ltr"><<a href="mailto:sdhari@hotmail.com">sdhari@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
In this scenario I do have typical Order and Items data structure. I want to<br>
implement various business rules where I want to check both Order attributes<br>
and Item attributes together.<br>
<br>
Order [ Date, Discount, Amount, Customer, Type, Items]<br>
Item [ Quantity, Rate, ExpiresDate, Grade ]<br>
<br>
I am trying to implements following rules but all gives me syntax error. I<br>
wondering if someone can help me in.<br>
<br>
<br>
rule “one”<br>
when<br>
Order ( $discount : Discount, $items : Items)<br>
Item ($discount > 10 && Grade > 3) from $items<br>
then<br>
System.err.print(“Discount is not allowed with items having grade 3 or<br>
higher)<br>
end<br>
<br>
rule “two”<br>
when<br>
Order ( $discount : Discount, $items : Items)<br>
Item ($discount > 20 || Quantity < 5 ) from $items<br>
then<br>
//do some thinge<br>
end<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Using-Collections-in-LHS-tp386923p386923.html" target="_blank">http://n3.nabble.com/Using-Collections-in-LHS-tp386923p386923.html</a><br>
Sent from the Drools - User mailing list archive at 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>
</font></blockquote></div><br>