[rules-users] Marshalling/Unmarshalling KnowledgeBase/StatefulSession
Wolfgang Laun
wolfgang.laun at gmail.com
Thu Aug 23 02:51:50 EDT 2012
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 at 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 at gmail.com
>
>
>
>
More information about the rules-users
mailing list