Hi,
I try to use a property of a javabean in LHS of a rule, it failed with an error message "Can't call method on nil reference: size.". Below is my code. Anyone knows what I did wrong or how should I do it please please help.
public class JessData {
private ArrayList list;
public void setList(ArrayList lst) {
list = lst;
}
public ArrayList getList() {
return list;
}
...
}
In Jess:
(import java.util.*)
(defclass data JessData)
(bind ?x (new JessData))
(definstance data ?x static)
(defrule test_rule
(data (list ?y&: (> (?y size) 0)))
=>
(printout t "test_rule fired" crlf))
I also tried using (
test (> (?y size) 0)) I got the same error.
Thanks a lot in advance.