Hi,

public class Order {
Buyer   buyer;
List<Item>orderItems = new ArrayList<Item>();

public List<Item> getOrderItems() {
return orderItems;
}
public void setOrderItems(List<Item> items) {
this.orderItems = items;
}
}

public class Item {

String id;
double price;
int  amount;
String catelogTag;

public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}


business rule 

import base.Order;
import base.Item;

rule "rule1"
when
$o: Order($b : buyer);
eval ($b != null && $b.getUserLevel() == UserTag.TAG[UserTag.TA]);
then    
System.out.println("");  
end


rule "rule2"
when
$o:Order($b : buyer);
#here is the error message in eclipse: "Item could not be resolved"
$i:Item() from $o.orderItems;
then    
System.out.println("");  
end

when I try to build the rule and run case, I got the following error in 
Rule Compilation error : [Rule name='rule2']
Rule_rule2_0.java (8:785) : item cannot be resolved

1. What is my error in the code and how to get that every Item in the 
orderItems 
list?
2. Another question is how to get source code when build the rule via eclise 
plugin?

thinks in advance


      
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to