<div dir="ltr"><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; font-family: monospace; font-size: medium; ">Hi, </pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; font-family: monospace; font-size: medium; ">
<br></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 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-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; font-family: monospace; font-size: medium; "><br></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; font-family: monospace; font-size: medium; ">
Currently i am using the following code:</pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; font-family: monospace; font-size: medium; "><br></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; ">
<span class="Apple-style-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-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "><span class="Apple-style-span" style="font-size: medium;"><b>                private KnowledgeBase kb = KnowledgeBaseFactory.newKnowledgeBase();
                kb.addKnowledgePackages(kbuilder.getKnowledgePackages());</b></span></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "><span class="Apple-style-span" style="font-size: medium;"><b><br>
</b></span></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "><span class="Apple-style-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-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "><span class="Apple-style-span" style="font-size: medium;"><br></span></pre><pre style="margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; ">
<span class="Apple-style-span" style="font-size: medium;">Thanks</span></pre></div>