<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>These test classes do that between them (with a bit of help from some others):</div><div><br></div><div><a href="https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/test/java/com/sctrcd/drools/spring/DroolsSpringTest.java">https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/test/java/com/sctrcd/drools/spring/DroolsSpringTest.java</a></div><div><br></div><div><a href="https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/test/java/com/sctrcd/drools/spring/DroolsSpringTestConfig.java">https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/test/java/com/sctrcd/drools/spring/DroolsSpringTestConfig.java</a></div><div><br></div><div>You will probably need to follow the path through the code to understand how that application does it.</div><div><br></div><div>tl;dr - If you don’t want to do that, then below is a method for creating a KieServices instance; after which, you need something like:</div><div><br></div><div><span class="k" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> KieContainer </span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">kieContainer</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> </span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> </span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">kieServices</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">.</span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">newKieContainer</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">(</span><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">kieServices</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">.</span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">getRepository</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">().</span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">getDefaultReleaseId</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">());</span></div><div><div><span class="n" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> KieSession</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> </span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">kieSession</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> </span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"> </span><span style="color: rgb(0, 128, 128); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">kieContainer</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">.</span><span class="na" style="box-sizing: border-box; color: teal; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">newKieSession</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">(</span><span class="n" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; box-sizing: border-box;">SessionConfiguration</span><span class="o" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; box-sizing: border-box; color: teal;">getDefaultInstance</span><span class="o" style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; box-sizing: border-box; font-weight: bold;">()</span><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);">);</span></div></div><div><span class="o" style="box-sizing: border-box; font-weight: bold; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 18px; white-space: pre; background-color: rgb(255, 255, 255);"><br></span></div><div><br></div><div><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); line-height: 18px;"><div class="line" id="LC95" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="kd" style="box-sizing: border-box; font-weight: bold;">private</span> <span class="kt" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">void</span> <span class="nf" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">createAndBuildKieServices</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">DroolsResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">[]</span> <span class="n" style="box-sizing: border-box;">resources</span><span class="o" style="box-sizing: border-box; font-weight: bold;">)</span> <span class="kd" style="box-sizing: border-box; font-weight: bold;">throws</span> <span class="n" style="box-sizing: border-box;">KieBuildException</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC96" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">this</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">kieServices</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="n" style="box-sizing: border-box;">KieServices</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">Factory</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">get</span><span class="o" style="box-sizing: border-box; font-weight: bold;">();</span></div><div class="line" id="LC97" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">this</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">kfs</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="n" style="box-sizing: border-box;">newKieFileSystem</span><span class="o" style="box-sizing: border-box; font-weight: bold;">();</span></div><div class="line" id="LC98" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC99" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">for</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">DroolsResource</span> <span class="n" style="box-sizing: border-box;">resource</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">:</span> <span class="n" style="box-sizing: border-box;">resources</span><span class="o" style="box-sizing: border-box; font-weight: bold;">)</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC100" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">log</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">info</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"Resource: "</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getType</span><span class="o" style="box-sizing: border-box; font-weight: bold;">()</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">", path type="</span></div><div class="line" id="LC101" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPathType</span><span class="o" style="box-sizing: border-box; font-weight: bold;">()</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">", path="</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPath</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC102" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">switch</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPathType</span><span class="o" style="box-sizing: border-box; font-weight: bold;">())</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC103" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">case</span> <span class="nl" style="box-sizing: border-box;">CLASSPATH:</span></div><div class="line" id="LC104" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">this</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">kfs</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">write</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">ResourceFactory</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">newClassPathResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPath</span><span class="o" style="box-sizing: border-box; font-weight: bold;">()));</span></div><div class="line" id="LC105" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">break</span><span class="o" style="box-sizing: border-box; font-weight: bold;">;</span></div><div class="line" id="LC106" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">case</span> <span class="nl" style="box-sizing: border-box;">FILE:</span></div><div class="line" id="LC107" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">this</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">kfs</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">write</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">ResourceFactory</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">newFileResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPath</span><span class="o" style="box-sizing: border-box; font-weight: bold;">()));</span></div><div class="line" id="LC108" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">break</span><span class="o" style="box-sizing: border-box; font-weight: bold;">;</span></div><div class="line" id="LC109" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">case</span> <span class="nl" style="box-sizing: border-box;">URL:</span></div><div class="line" id="LC110" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">UrlResource</span> <span class="n" style="box-sizing: border-box;">urlResource</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">UrlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">)</span> <span class="n" style="box-sizing: border-box;">ResourceFactory</span></div><div class="line" id="LC111" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">newUrlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPath</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC112" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC113" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">if</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getUsername</span><span class="o" style="box-sizing: border-box; font-weight: bold;">()</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">!=</span> <span class="kc" style="box-sizing: border-box; font-weight: bold;">null</span><span class="o" style="box-sizing: border-box; font-weight: bold;">)</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC114" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">log</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">info</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"Setting authentication for: "</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getUsername</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC115" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">urlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">setBasicAuthentication</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"enabled"</span><span class="o" style="box-sizing: border-box; font-weight: bold;">);</span></div><div class="line" id="LC116" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">urlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">setUsername</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getUsername</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC117" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">urlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">setPassword</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">resource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getPassword</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC118" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div><div class="line" id="LC119" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC120" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">this</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">kfs</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">write</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">urlResource</span><span class="o" style="box-sizing: border-box; font-weight: bold;">);</span></div><div class="line" id="LC121" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC122" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">break</span><span class="o" style="box-sizing: border-box; font-weight: bold;">;</span></div><div class="line" id="LC123" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">default</span><span class="o" style="box-sizing: border-box; font-weight: bold;">:</span></div><div class="line" id="LC124" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">throw</span> <span class="k" style="box-sizing: border-box; font-weight: bold;">new</span> <span class="nf" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">IllegalArgumentException</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span></div><div class="line" id="LC125" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"Unable to build this resource path type."</span><span class="o" style="box-sizing: border-box; font-weight: bold;">);</span></div><div class="line" id="LC126" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div><div class="line" id="LC127" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div><div class="line" id="LC128" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC129" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">KieBuilder</span> <span class="n" style="box-sizing: border-box;">kieBuilder</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="n" style="box-sizing: border-box;">kieServices</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">newKieBuilder</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">kfs</span><span class="o" style="box-sizing: border-box; font-weight: bold;">).</span><span class="na" style="box-sizing: border-box; color: teal;">buildAll</span><span class="o" style="box-sizing: border-box; font-weight: bold;">();</span></div><div class="line" id="LC130" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC131" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">if</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">kieBuilder</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getResults</span><span class="o" style="box-sizing: border-box; font-weight: bold;">().</span><span class="na" style="box-sizing: border-box; color: teal;">hasMessages</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">Level</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">ERROR</span><span class="o" style="box-sizing: border-box; font-weight: bold;">))</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC132" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">List</span><span class="o" style="box-sizing: border-box; font-weight: bold;"><</span><span class="n" style="box-sizing: border-box;">Message</span><span class="o" style="box-sizing: border-box; font-weight: bold;">></span> <span class="n" style="box-sizing: border-box;">errors</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="n" style="box-sizing: border-box;">kieBuilder</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">getResults</span><span class="o" style="box-sizing: border-box; font-weight: bold;">().</span><span class="na" style="box-sizing: border-box; color: teal;">getMessages</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">Level</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">ERROR</span><span class="o" style="box-sizing: border-box; font-weight: bold;">);</span></div><div class="line" id="LC133" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">StringBuilder</span> <span class="n" style="box-sizing: border-box;">sb</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="k" style="box-sizing: border-box; font-weight: bold;">new</span> <span class="n" style="box-sizing: border-box;">StringBuilder</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"Errors:"</span><span class="o" style="box-sizing: border-box; font-weight: bold;">);</span></div><div class="line" id="LC134" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">for</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">Message</span> <span class="n" style="box-sizing: border-box;">msg</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">:</span> <span class="n" style="box-sizing: border-box;">errors</span><span class="o" style="box-sizing: border-box; font-weight: bold;">)</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">{</span></div><div class="line" id="LC135" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">sb</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">append</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"\n "</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">prettyBuildMessage</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">msg</span><span class="o" style="box-sizing: border-box; font-weight: bold;">));</span></div><div class="line" id="LC136" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div><div class="line" id="LC137" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="k" style="box-sizing: border-box; font-weight: bold;">throw</span> <span class="k" style="box-sizing: border-box; font-weight: bold;">new</span> <span class="nf" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">KieBuildException</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="n" style="box-sizing: border-box;">sb</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">toString</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC138" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div><div class="line" id="LC139" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> </div><div class="line" id="LC140" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="n" style="box-sizing: border-box;">log</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="na" style="box-sizing: border-box; color: teal;">info</span><span class="o" style="box-sizing: border-box; font-weight: bold;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">"KieServices built: "</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">+</span> <span class="n" style="box-sizing: border-box;">toString</span><span class="o" style="box-sizing: border-box; font-weight: bold;">());</span></div><div class="line" id="LC141" style="box-sizing: border-box; padding-left: 10px; height: 18px;"> <span class="o" style="box-sizing: border-box; font-weight: bold;">}</span></div></pre></div><div><br></div><div>... where DroolsResource is this:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/main/java/com/sctrcd/drools/DroolsResource.java">https://github.com/gratiartis/qzr/blob/master/sctrcd-drools/src/main/java/com/sctrcd/drools/DroolsResource.java</a></div><div><br></div><div><br></div></body></html>