Notice the lack of a space before the '?' in: Program text: ( defrule show-adv-attributes?fact <-
You failed the parse of the program because of this. It thinks your rule name is show-adv-attributes?fact. Bob Orchard National Research Council Canada Conseil national de recherches Canada Institute for Information Technology Institut de technologie de l'information 1200 Montreal Road, Building M-50 M50, 1200 chemin Montrial Ottawa, ON, Canada K1A 0R6 Ottawa (Ontario) Canada K1A 0R6 (613) 993-8557 (613) 952-0215 Fax / tilicopieur [EMAIL PROTECTED] Government of Canada | Gouvernement du Canada -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of calvin pevee Sent: Tuesday, August 10, 2004 2:15 AM To: [EMAIL PROTECTED] Subject: Re: AW: JESS: How to match Pattern in Facts Hi, Need help here. I do not know how to get the facts out when it is embeded in Java. I ran the code in Java:- r.executeCommand("(deftemplate adv-attributes" + "(slot id)" + "(multislot attribs))"); r.executeCommand("(defrule show-adv-attributes" + //"?fact <- (adv-attributes (id ?id) (attribs ?attribs))" + "(adv-attributes (id ?id) (attribs ?attribs))" + "=>" + "(printout t \"-------------------------\" crlf)" + //"(printout t \"Fact-id=\" ?fact crlf)" + // declare a list variable, so that it will append one by one? "(printout t \"id=\" ?id crlf)" + "(printout t \"attribs=\" ?attribs crlf))"); r.reset(); r.executeCommand("(assert (adv-attributes (id 1) (attribs low-budget)))"); r.executeCommand("(assert (adv-attributes (id 2) (attribs control-message-frequency)))"); r.run(); Java throws me this exception:- Jess reported an error in routine Jesp.parseDefrule. Message: Expected '=>' . Program text: ( defrule show-adv-attributes?fact <- at line 1. I commented a few lines, I can see that the rule is fired twice. How can I grep the rules which is fired and how do I know which factID is fired is I cannot use ?fact <- (adv-attributes (id $id) (attribs $attribs))? ------------------------- id=2attribs=control-message-frequency ------------------------- id=1attribs=low-budget f-0 (MAIN::initial-fact) f-1 (MAIN::adv-attributes (id 1) (attribs low-budget)) f-2 (MAIN::adv-attributes (id 2) (attribs control-message-frequency)) For a total of 3 facts. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -------------------------------------------------------------------- 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] --------------------------------------------------------------------