<div dir="ltr">Thanks, I will try that...<br><br><div class="gmail_quote">2010/11/18 Anderson Rocha <span dir="ltr"><<a href="mailto:anderson.ufal@gmail.com">anderson.ufal@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You can also use the CHANGE_SET.<br><br><a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e890" target="_blank">http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e890</a><br>
<br>A change_set example, where "rules" and "ruleflows" are folders that must contain just .drl and .drf files <span lang="en"><span style="background-color:rgb(230, 236, 249);color:rgb(0, 0, 0)" title="">respectively</span></span>:<br>
<br><?xml version="1.0" encoding="UTF-8"?><br><br><change-set xmlns='<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>'<br>
xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'<br>
xs:schemaLocation='<a href="http://drools.org/drools-5.0/change-set.xsd" target="_blank">http://drools.org/drools-5.0/change-set.xsd</a>' ><br> <br> <add><br> <resource source='classpath:rules' type='DRL' /><br>
<resource source='classpath:ruleflows' type='DRF' /><br> </add><br></change-set><br><br>Also take a look at the Knowledge Agent session.<br><br><a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e918" target="_blank">http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e918</a><br>
<br>Regards,<br>Anderson<br><br><div class="gmail_quote">2010/11/18 Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span><div><div></div><div class="h5">
<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
// Yesterday: serialize a KP collection<br>OutputStream os = new FileOutputStream( pkgPath );<br>ObjectOutputStream oos = new ObjectOutputStream( os );<br>oos.writeObject( kBuilder.getKnowledgePackages() );<br>oos.close();<br>
<br>// Today: load serialized packages<br>KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase(); <br>InputStream is = new FileInputStream( pkgPath );<br>ObjectInputStream ois = new ObjectInputStream( is );<br>@SuppressWarnings("unchecked")<br>
Collection<KnowledgePackage> kpkgs = (Collection<KnowledgePackage>) ois.readObject();<br>ois.close();<br>kBase.addKnowledgePackages( kpkgs );<br><br>You may, of course, add more packages, compiled now.<br>-W<br>
<br><div class="gmail_quote">2010/11/18 Yaniv Itzhaki <span dir="ltr"><<a href="mailto:iyaniv@gmail.com" target="_blank">iyaniv@gmail.com</a>></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>
<div dir="ltr"><pre style="margin:0em;font-family:monospace;font-size:medium">Hi, </pre><pre style="margin:0em;font-family:monospace;font-size:medium"><br></pre><pre style="margin:0em;font-family:monospace;font-size:medium">
I wanted to know if it is possible to precompile rules/flows and load them on demand?</pre>
<pre style="margin:0em;font-family:monospace;font-size:medium"><br></pre><pre style="margin:0em;font-family:monospace;font-size:medium">Currently i am using the following code:</pre><pre style="margin:0em;font-family:monospace;font-size:medium">
<br></pre><pre style="margin:0em"><span style="font-size:medium">                <b>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
                for (String file : files) {
                        //(missing code) get files from directory and add them to KnowledgeBuilder (source files - rules and flows) <br>
                        kbuilder.add(ResourceFactory.newFileResource(file), type);
                }
<br></b></span></pre><pre style="margin:0em"><span style="font-size:medium"><b> private KnowledgeBase kb = KnowledgeBaseFactory.newKnowledgeBase();
                kb.addKnowledgePackages(kbuilder.getKnowledgePackages());</b></span></pre><pre style="margin:0em"><span style="font-size:medium"><b><br>
</b></span></pre><pre style="margin:0em"><span style="font-size:medium">Is there an option to add already precompiled files into KnowledgeBase and not compile them only during the initialization phase?</span></pre>
<pre style="margin:0em"><span style="font-size:medium"><br></span></pre><pre style="margin:0em"><span style="font-size:medium">Thanks</span></pre></div>
<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" 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></div></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></div>