<div>Are you experiencing any error? Or it just doesn't work as you expected?</div><div>Try doing a test without using kagent. Try to create a new KBase and add the serialized packages you have.</div><div><br></div><br>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 1:07 PM, jrob <span dir="ltr"><<a href="mailto:josh.roberts@cerner.com">josh.roberts@cerner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Did you actually get this to work? I have tried both ways to create a .PKG<br>
mentioned here and still haven't got it to work.<br>
<br>
FILE CREATION CODE (Commented out portions are for direct serialization):<br>
public static void createPKG(Collection<KnowledgePackage> kpkgs, File file)<br>
throws IOException, FileNotFoundException<br>
{<br>
FileOutputStream fos = null;<br>
ObjectOutputStream out = null;<br>
<br>
fos = new FileOutputStream(file);<br>
out = new ObjectOutputStream(fos);<br>
<br>
try<br>
{<br>
//out.writeObject(kpkgs);<br>
DroolsStreamUtils.streamOut(fos, kpkgs);<br>
}<br>
catch (IOException e)<br>
{<br>
String error ="Could not serialize object!";<br>
logger.error(error);<br>
throw new DroolsPKGCreatorException(error,e);<br>
}<br>
finally<br>
{<br>
try<br>
{<br>
//out.close();<br>
fos.close();<br>
}<br>
catch (IOException e)<br>
{<br>
logger.error("Could not close stream during serialization!",e);<br>
}<br>
}<br>
<br>
}<br>
<br>
KBASE CREATION FROM PKG<br>
<br>
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(<br>
"MyKnowledgeAgent" );<br>
kagent.applyChangeSet(ResourceFactory.newClassPathResource(/* file created<br>
from above method */));<br>
<br>
KnowledgeBase kbase = kagent.getKnowledgeBase();<br>
<br>
Am I doing something wrong? Thanks for the help!<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/creating-pkg-from-drl-tp694012p1023150.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/creating-pkg-from-drl-tp694012p1023150.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>