You serialize Knowledge just like any POJO.
ObjectOutputStream out =
new ObjectOutputStream( new FileOutputStream( pkgPath ) );
out.writeObject( kBuilder.getKnowledgePackages() );
out.close();
//==========================
ObjectInputStream in =
new ObjectInputStream( new FileInputStream( pkgPath ) );
@SuppressWarnings( "unchecked" )
Collection<KnowledgePackage> kpkgs =
(Collection<KnowledgePackage>)in.readObject();
in.close();
kBase.addKnowledgePackages( kpkgs );
Or you can do the same with the Knowledge Base.
-W
On 23/08/2012, Paulo Reis <casmeiron(a)gmail.com> wrote:
Hi guys,
Im having some issues with the time drools takes to build a knowledge base.
I have couple of pkgs that are compiled (something about 3mb) and drools
takes almost 5s to give me the knowledge.
So I would like to know whether I could serialize the knowledge base on the
database or even the stateful session that was built using the related
knowledge. Is there any example that I could follow?
If you guys know other ways to improve the performance, please let me know.
Thanks in advance.
Paulo Reis
casmeiron(a)gmail.com