Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
if (verboseoption) {
Iterator<KnowledgePackage> iter = pkgs.iterator();
while (iter.hasNext()) {
KnowledgePackage pkg = iter.next();
log("** Content of package: " + pkg.getName());
Iterator<Rule> riter = pkg.getRules().iterator();
while (riter.hasNext()) {
log("\tRule name: " + riter.next().getName());
}
}
}
// creates the knowledge base
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
// adds the packages
kbase.addKnowledgePackages(pkgs);
if (PACKAGEBINFORMAT.equals(binformat)) {
Iterator<KnowledgePackage> iter = pkgs.iterator();
while (iter.hasNext()) {
KnowledgePackage pkg = iter.next();
if (verboseoption) {
log("** Serializing package [" + pkg.getName() + "] to destination file. **** THIS WILL OVERRIDE ANY PREVIOUSLY SERIALIZED PACKAGE ****");
}
serializeObject(pkg);
}
} else {
if (verboseoption) {