Thanks, and this should get me started.<br>I find that most of the documentation is eclipse-centric, and probably it would help for the newbies like me, if the documentation also includes more material on usage with other IDEs.<br>
<br>Thanks again<br>Regards,<br>kp <br><br><div class="gmail_quote">2009/5/3 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is what you might do:<br><br><br>        KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();<br>        KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();<br>        kBuilder.add( ResourceFactory.newFileResource( &quot;Movie.drl&quot; ),<br>

                      ResourceType.DRL );<br>        if( kBuilder.hasErrors() ){<br>            for( KnowledgeBuilderError err: kBuilder.getErrors() ){<br>                System.out.println( err.toString() );<br>            }<br>

            throw new IllegalStateException( &quot;DRL errors&quot; );<br>        }<br><br>        OutputStream os = new FileOutputStream( &quot;Movie.pkg&quot; );<br>        ObjectOutputStream oos = new ObjectOutputStream( os );<br>

<br>        oos.writeObject( kBuilder.getKnowledgePackages() );<br>        <br>// And now, from the file containing the binary knowlewdge packages:<br><br>        InputStream is = new FileInputStream( &quot;Movie.pkg&quot; );<br>

        ObjectInputStream ois = new ObjectInputStream( is );<br>        @SuppressWarnings(&quot;unchecked&quot;)<br>        Collection&lt;KnowledgePackage&gt; kpkgs = (Collection&lt;KnowledgePackage&gt;) ois.readObject();<br>

        ois.close();<br><br>        kBase.addKnowledgePackages( kpkgs );<br><br>-W<br><br><br><div class="gmail_quote">2009/5/2 Perumaal Krishnaraj <span dir="ltr">&lt;<a href="mailto:perumaal.k@gmail.com" target="_blank">perumaal.k@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hello Everybody,<br>I&#39;m a newbie to Drools, so please excuse me, if question is very fundamental.<br>

I&#39;m not using drools with eclipse or brms.<br>I would like to convert the drl file which I had created using a text editor to the binary form ie. in pkg format (serialized), which can be used im my Java application.<br>


<br>Is there a tool, or a code snippet which gives me an idea as to how this is done.<br><br>Regards,<br>kp<br><br><br><br>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></blockquote></div><br>
<br>_______________________________________________<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>
<br></blockquote></div><br>