Skip to content

Instantly share code, notes, and snippets.

@mpellegrini
Created August 31, 2011 00:24
Show Gist options
  • Save mpellegrini/1182507 to your computer and use it in GitHub Desktop.
Save mpellegrini/1182507 to your computer and use it in GitHub Desktop.
Prints out JBoss Rules or Drools KnowledgeBase contents to the console
// Prints out KnowledgeBase contents to the console
Collection<KnowledgePackage> pkgs = kbase.getKnowledgePackages();
for (KnowledgePackage pkg : pkgs) {
System.out.println("* " + pkg.getName());
Collection<Rule> rules = pkg.getRules();
for (Rule rule : rules) {
System.out.println(" - " + rule.getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment