try: Iterator it = rete.listDefrules(); while( it.hasNext() ) { Defrule defrule = (Defrule)it.next(); String ruleText = new jess.PrettyPrinter( defrule ).toString(); System.out.println("->" + ruleText + "<-); }
Note: this code has not been compiled/tested but should be a start... Good luck! alan > -----Original Message----- > From: Alexander Lamb [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 7:35 AM > To: [EMAIL PROTECTED] > Subject: JESS: ToString in class Defrule? > > > Hello, > > Trying to trace a few things from my Java application, I > thought of using: > > Iterator it = rete.listDefrules(); > > To find all the rules, then for each Defrule object use toString. > Unfortunately, it doesn't print the rule itself, only a > reference. How do I > get the actual "string" of the rule? > > Thanks, > > Alexander > > -- > Alexander Lamb > Groupe Serveurs Applicatifs > Division d'Informatique Midicale > Htpitaux Universitaires de Genhve > 21 rue Micheli-du-Crest > CH-1211 Genhve 4 / Switzerland > Tel: +41-22 372.48.46 Fax: +41-22 372.61.98 > [EMAIL PROTECTED] / http://www.hcuge.ch > > -------------------------------------------------------------------- > 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] --------------------------------------------------------------------