JESS: how to dumping rules ?
Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... Jess (rules) For a total of 0 rules in module MAIN. Jess (defrule x (f $? )=) TRUE Jess (rules) MAIN::x For a total of 1 rules in module MAIN. Jess (bind ?rulelist (rules)) MAIN::x For a total of 1 rules in module MAIN. Jess ( foreach ?v ?rulelist (ppdefrule ?v )) Jess reported an error in routine foreach while executing (foreach ?v ?rulelist (ppdefrule ?v)). Message: Argument must be ValueVector, Collection, or Iterator: nil. Program text: ( foreach ?v ?rulelist ( ppdefrule ?v ) ) at line 6. Jess (printout t ?rulelist) nil Jess Kind Regards, joe To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: how to dumping rules ?
(rules) just prints, returning nil. (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) -W On Wed, Sep 2, 2009 at 11:25 AM, jo etaoi...@yahoo.com wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... Jess (rules) For a total of 0 rules in module MAIN. Jess (defrule x (f $? )=) TRUE Jess (rules) MAIN::x For a total of 1 rules in module MAIN. Jess (bind ?rulelist (rules)) MAIN::x For a total of 1 rules in module MAIN. Jess ( foreach ?v ?rulelist (ppdefrule ?v )) Jess reported an error in routine foreach while executing (foreach ?v ?rulelist (ppdefrule ?v)). Message: Argument must be ValueVector, Collection, or Iterator: nil. Program text: ( foreach ?v ?rulelist ( ppdefrule ?v ) ) at line 6. Jess (printout t ?rulelist) nil Jess Kind Regards, joe To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: how to dumping rules ?
On Sep 2, 2009, at 5:25 AM, jo wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... That's what (ppdefrule *) does. - Ernest Friedman-Hill Informatics Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: how to dumping rules ?
Looks like (ppdefrule *) is sufficient, Jess (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) Jess reported an error in routine call while executing (call (engine) findDefrule ?__rule) while executing (bind ?__defrule (call (engine) findDefrule ?__rule)) while executing (if (eq ?__rule *) then (bind ?sb (new StringBuffer)) (bind ?it (call (engine) listDefrules)) (while (call ?it hasNext) (call ?sb append (new jess.PrettyPrinter (call ?it next))) (call ?sb append )) (call ?sb toString) else (bind ?__defrule (call (engine) findDefrule ?__rule)) (if (neq ?__defrule nil) then (call (new jess.PrettyPrinter ?__defrule) toString) else (str-cat No such rule: ?__rule))) while executing deffunction ppdefrule while executing (ppdefrule ?v) while executing (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)). Message: No overloading of method 'findDefrule' in class jess.Rete I can call with these arguments: (call (engine) findDefrule ?__rule). Program text: ( foreach ?v ( explode$ ( ppdefrule * ) ) ( ppdefrule ?v ) ) at line 3. Je From: Wolfgang Laun wolfgang.l...@gmail.com To: jess-users@sandia.gov Sent: Wednesday, September 2, 2009 1:55:47 PM Subject: Re: JESS: how to dumping rules ? (rules) just prints, returning nil. (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) -W On Wed, Sep 2, 2009 at 11:25 AM, jo etaoi...@yahoo.com wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... Jess (rules) For a total of 0 rules in module MAIN. Jess (defrule x (f $? )=) TRUE Jess (rules) MAIN::x For a total of 1 rules in module MAIN. Jess (bind ?rulelist (rules)) MAIN::x For a total of 1 rules in module MAIN. Jess ( foreach ?v ?rulelist (ppdefrule ?v )) Jess reported an error in routine foreach while executing (foreach ?v ?rulelist (ppdefrule ?v)). Message: Argument must be ValueVector, Collection, or Iterator: nil. Program text: ( foreach ?v ?rulelist ( ppdefrule ?v ) ) at line 6. Jess (printout t ?rulelist) nil Jess Kind Regards, joe To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: how to dumping rules ?
On Wed, Sep 2, 2009 at 1:55 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: (rules) just prints, returning nil. This is correct. (foreach ?v (explode$ (ppdefrule *)) (ppdefrule ?v)) This is nonsense, -W
Re: JESS: how to dumping rules ?
Maybe that is what you want? (bind ?it ((engine) listDefrules)) (while (?it hasNext) (printout t (ppdefrule ((?it next) getName)) crlf crlf) ) Regards, Florian On Wed, Sep 2, 2009 at 11:25 AM, jo etaoi...@yahoo.com mailto:etaoi...@yahoo.com wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... -- Florian Fischer Hôpitaux Universitaires de Genève Service d'Informatique Médicale Rue Gabrielle-Perret-Gentil 4 CH-1211 Genève 14 Tél: +41 22 3728861 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
Re: JESS: how to dumping rules ?
Cool, works like a charm... Thanks Joe - Original Message From: Florian Fischer florian.fisc...@sim.hcuge.ch To: jess-users@sandia.gov Sent: Wednesday, September 2, 2009 3:56:32 PM Subject: Re: JESS: how to dumping rules ? Maybe that is what you want? (bind ?it ((engine) listDefrules)) (while (?it hasNext) (printout t (ppdefrule ((?it next) getName)) crlf crlf) ) Regards, Florian On Wed, Sep 2, 2009 at 11:25 AM, jo etaoi...@yahoo.com mailto:etaoi...@yahoo.com wrote: Hi I tried to dump the rules loaded at some point in time as follows but it did not work out... I do not know the names beforehand and have to figure out why they are not firing... -- Florian Fischer Hôpitaux Universitaires de Genève Service d'Informatique Médicale Rue Gabrielle-Perret-Gentil 4 CH-1211 Genève 14 Tél: +41 22 3728861 To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov. To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.