On 03.04.2010 00:40, Amit Kumar wrote:
I am trying to create a .pkg file (for probably faster loading) from a
Does anybody has a code snippet which I can use. Am unable to find it
from what we figured out at work, they're just plain serialized
knowledge packages (or rather, collections thereof). IIRC, this is also
described somewhere in the docs.
So all you need to do is:
- create the knowledge packages in-memory using the normal
KnowledgeBuilder api calls (loads of documentation available for this)
- use java object serialization to write a Collection<KnowledgePackage>
into a file.
Upon loading these packages, make sure all the classes used/imported in
the *.drl files are available on the classpath, otherwise you probably
won't be able to deserialize the packages.