[rules-users] Using Collections in LHS

dhari sdhari at hotmail.com
Tue Feb 23 07:11:05 EST 2010


In this scenario I do have typical Order and Items data structure. I want to
implement various business rules where I want to check both Order attributes
and Item attributes together.

Order [ Date, Discount, Amount, Customer, Type, Items]
Item [ Quantity, Rate, ExpiresDate, Grade ]

I am trying to implements following rules but all gives me syntax error. I
wondering if someone can help me in.


rule “one”
    when
	Order  ( $discount : Discount, $items : Items)
	Item ($discount > 10 && Grade > 3) from $items
    then
	System.err.print(“Discount is not allowed with items having grade 3 or
higher)
end

rule “two”
    when
	Order  ( $discount : Discount, $items : Items)
	Item ($discount  > 20 || Quantity < 5 ) from $items
    then
	//do some thinge
end
-- 
View this message in context: http://n3.nabble.com/Using-Collections-in-LHS-tp386923p386923.html
Sent from the Drools - User mailing list archive at Nabble.com.




More information about the rules-users mailing list