[rules-users] How to serialize a KnowledgeBase?

David Boaz davidb at dbmotion.com
Wed Dec 31 09:07:17 EST 2008


Hi all,

Im currently developing a new application using drools 5.0 M4. Im using this
style (from KnowledgeBuilder javadoc):

1- KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
2- kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ),
                       ResourceType.DRL);
3- assertFalse( kbuilder.hasErrors() );
4- KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

Now, for optimization reasons, I want to save kbase. The problem is that it
is not serializable.
Probably, Im trying to serialize the wrong object.

can someone please guide me how to do that?

BTW, I have another question, How the KBFactory on line 4 knows the builder
used in lines 1 and 2? Will it actually work?

Thanks, David
-- 
View this message in context: http://www.nabble.com/How-to-serialize-a-KnowledgeBase--tp21231939p21231939.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list