Re: JESS: Mixing facts from Java and Jess script
On Dec 18, 2006, at 10:13 PM, Mike Stacey wrote: (defrule TA::Initiates (mon (reading ?r:(= ?r 143)) (tstamp ?t:( ?t 0)) (posLshift (truth_val false))) = (assert posLshift(truth_val 1)) (printout t Initiates: Data ?r bpm, timestamp ?t, Fluent truth count:crlf)) Error is: Jess reported an error in routine Jesp.parsePattern while executing (batch rules/ec-1.clp). Message: No such slot posLshift in template MAIN::mon at token 'posLshift'. There's a missing close-parenthesis on the first line (three open, only two close) so Jess thinks you mean to test the contents of the tstamp and posLshift slots in a mon fact. The JessDE is pretty good at helping you spot this sort of problem. Besides formatting your code so that your errors are more obvious, this kind of error will lead to a train wreck with all sorts of error markers from this point on in the file, giving you a strong hint that something is wrong. If you can't use the JessDE, use the Lisp mode in any programmer's editor -- it will know how to format Jess code to point out this error. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (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]
Re: JESS: Mixing facts from Java and Jess script
But I think he closes this on the third line. On Dec 18, 2006, at 9:11 PM, Ernest Friedman-Hill wrote: On Dec 18, 2006, at 10:13 PM, Mike Stacey wrote: (defrule TA::Initiates (mon (reading ?r:(= ?r 143)) (tstamp ?t:( ?t 0)) (posLshift (truth_val false))) = (assert posLshift(truth_val 1)) (printout t Initiates: Data ?r bpm, timestamp ?t, Fluent truth count:crlf)) Error is: Jess reported an error in routine Jesp.parsePattern while executing (batch rules/ec-1.clp). Message: No such slot posLshift in template MAIN::mon at token 'posLshift'. There's a missing close-parenthesis on the first line (three open, only two close) so Jess thinks you mean to test the contents of the tstamp and posLshift slots in a mon fact. The JessDE is pretty good at helping you spot this sort of problem. Besides formatting your code so that your errors are more obvious, this kind of error will lead to a train wreck with all sorts of error markers from this point on in the file, giving you a strong hint that something is wrong. If you can't use the JessDE, use the Lisp mode in any programmer's editor -- it will know how to format Jess code to point out this error. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (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 owner-jess- [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]
RE: JESS: Mixing facts from Java and Jess script
He does close it on the third line, but that is what the problem is. The way the rule is defined below, the mon template should contain slots for reading, tstamp and posLshift. However, based on the error, the mon template generated by the defclass call does not contain the posLshift slot. So the last close-parenthesis after the posLshift line needs to be placed after the tstamp slot (assuming tstamp is part of the mon template). This will associate the reading and tstamp slots with the mon template and the truth_val slot with the posLshift template. Scott -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J Michael Dean Sent: Tuesday, December 19, 2006 10:06 AM To: jess-users@sandia.gov Subject: Re: JESS: Mixing facts from Java and Jess script But I think he closes this on the third line. On Dec 18, 2006, at 9:11 PM, Ernest Friedman-Hill wrote: On Dec 18, 2006, at 10:13 PM, Mike Stacey wrote: (defrule TA::Initiates (mon (reading ?r:(= ?r 143)) (tstamp ?t:( ?t 0)) (posLshift (truth_val false))) = (assert posLshift(truth_val 1)) (printout t Initiates: Data ?r bpm, timestamp ?t, Fluent truth count:crlf)) Error is: Jess reported an error in routine Jesp.parsePattern while executing (batch rules/ec-1.clp). Message: No such slot posLshift in template MAIN::mon at token 'posLshift'. There's a missing close-parenthesis on the first line (three open, only two close) so Jess thinks you mean to test the contents of the tstamp and posLshift slots in a mon fact. The JessDE is pretty good at helping you spot this sort of problem. Besides formatting your code so that your errors are more obvious, this kind of error will lead to a train wreck with all sorts of error markers from this point on in the file, giving you a strong hint that something is wrong. If you can't use the JessDE, use the Lisp mode in any programmer's editor -- it will know how to format Jess code to point out this error. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (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 owner-jess- [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] 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]