下面是我的类的结构:
public class Address {
private String street;
private int phone;
public void setStreet(String s){street = s;}
public void setPhone(int p){phone = p;}
public String getStreet(String s){return street;}
public int getPhone(){ return phone; }
}
public class Borrower {
Address adr = new Address();
public void setAddress(String s, int p) {
adr.setStreet(s);
adr.setPhone(p);
}
public Address getAddress() { return adr; }
}
我正在使用的 Drools 表达式:-
rule "Nested Address"
salience -10
when
$bo : Borrower(Address.street.equals("USA") && Address.phone != 717)
$loanApp : LoanApplication()
then
$loanApp.addFeedbackMessage(FeedbackMessages.LOCATION_NOT_US);
System.out.println("Nested Address " + $bo.adr.street + ", Nested Phone " + $bo.adr.phone);
end
上面给了我错误:
Unable to Analyse Expression Address.street.equals("USA"):
有人可以告诉我我做错了什么吗?