Hello Ernest, thanks for the quick response! 1) yes, the facts are in working memory: [...] f-4547 (MAIN::Person (ak "ANG06") (class <Java-Object:java.lang.Class>) (data "[OED|ANG06|2000|Gerdes|Harald|M|1961-08-12]") (gebdat <Java-Object:java.sql.Date>) (gebdatStr "1961-08-12") (geschl "M") (key "OED|ANG06|2000") (man "OED") (naname "Gerdes") (pnr "2000") (reference "?") (vorname "Harald") (OBJECT <Java-Object:com.PIAG.jess.Person>)) For a total of 4548 facts in module MAIN.
2) for the datetest i added a string returning function to Person and it works yes, there ist a getKey() method 3) yes, .run() was called 4) Person supports PropertyChangeListeners but this will not work: (defrule testit "" ?p1 <- (Person {key == "TMT|002|101"} (data ?data1)) ?p2 <- (Person {key == "011|002|5"} (data ?data2)) => (printout t "Bingo!" crlf) ) if i comment out the line with "?p1 <- ..." or "?p2 <- ..." the one fact match. but if i look for both facts, they are not found (i also tried with other attributes). regards klaus -----Ursprüngliche Nachricht----- Von: Ernest Friedman-Hill [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 23. November 2006 17:25 An: jess-users@sandia.gov Betreff: Re: JESS: Newbie-Question/Problem(?) Everything here looks quite reasonable, but of course, the devil is in the details. Things to make sure of: 1) The Person objects have to actually be added to working memory; you might use the "(facts)" function to check that. 2) The rules below will work if, and only if, Person has a "String getKey()" method and a "String getGebdat()" method, and they return precisely the values given in the rules. 3) Rules won't fire until you call "(run)" or jess.Rete.run(). 4) If Person doesn't support PropertyChangeListeners, then the Rete.updateObject() has to be called whenever an object's property values change, or Jess won't know about the new values until you call (reset). Feel free to follow up with questions, but try to provide evidence to support some of the above. On Nov 23, 2006, at 9:34 AM, Thiele, Klaus wrote: > Hello, > > i'm currently evaluating Rule-Engines. I've started with JBossRules, > currently i do some tests with Jess. > > I try to port my Testrules from JBRules to Jess and i can't get > these two > rules work: > ( > - Person is a JavaBean with getter/setter > - there are ~5000 Person-Objects in WorkingMemory > - behind 'data' is a getter-method which only returns string with all > attributes > ) > > (import com.PIAG.jess.Person) > (deftemplate Person (declare (from-class Person))) > > (defrule datetest "" > (Person {gebdat == "12-Aug-1961"} (data ?data)) > => > (printout t "datetest: " ?data crlf) > ) > > no matches! how to deal with 'date' datatypes? > > (defrule moditest "" > ?p1 <- (Person {key == "002|003|2034"} (data ?data1) (naname ? > naname1)) > ?p2 <- (Person {key == "UNST|002|3"} (data ?data2)) > => > (printout t "moditest: " ?data1 " - " ?data2 crlf) > (modify ?p2 (reference ?naname1)) > ) > > no matches! > > please point me in the right direction. currently i'm studing the > manuals > but i did'nt found anything > about my problem. > > regards > -klaus > > > -- > Klaus Thiele - Personal & Informatik AG > mailto:[EMAIL PROTECTED] > > "Ein wichtiger Charakterzug großartiger Programmierer ist > konstruktive > Faulheit..." > Eric S. Raymond > > > -------------------------------------------------------------------- > To unsubscribe, send the words 'unsubscribe jess-users > [EMAIL PROTECTED]' > in the BODY of a message to [EMAIL PROTECTED], NOT to the list > (use your own address!) List problems? Notify owner-jess- > [EMAIL PROTECTED] > -------------------------------------------------------------------- --------------------------------------------------------- Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] -------------------------------------------------------------------- -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------