This code allows you to get all the rules names of the rule base of your Working memory (wm)...

  Iterator it=wm.getRuleBase().getRuleSets().iterator();
  while (it.hasNext()) {
   RuleSet rs=(RuleSet)it.next();
   Rule[] r=rs.getRules();
   for (int i=0; i<r.length; i++) {
    System.out.println(r[i].getName());
   }
  }

Hope it help.

Ricardo Rojas
[EMAIL PROTECTED]

----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, November 08, 2005 8:16 AM
Subject: [drools-user] Obtaining rule names


Hi, is it possible to obtain the name of a rule i.e. <rule name="name of
rule"> ? Ideally this would be accessible through code in the drl file.
Thanks

Caroline Grima


Reply via email to