以下は私のクラスの構造です:
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"):
誰かが私が間違っていることを教えてもらえますか?