<div dir="ltr"><div>Hello again,<br><br>what are disadvantages and advantages of the following possibillities to to get access to working memory facts from outside:<br><br><ul><li>-uses a query:</li></ul><div style="margin-left: 40px;">
in drl:<br></div><pre style="margin-left: 40px;" class="programlisting">query &quot;<span style="font-family: arial,sans-serif;">queryname</span>&quot;<br>    ...<br>end<br><br>in java code<br></pre><div style="margin-left: 40px;">
<span style="font-family: arial,sans-serif;">queryResults results = workingMemory.getQueryResults( &quot;queryname&quot; );</span><span style="font-family: arial,sans-serif;"></span><br style="font-family: arial,sans-serif;">
</div><ul><li>-use globals that store facts:</li></ul></div><div style="margin-left: 40px;"><pre>global java.util.HashMap service <br>rule &quot;XY&quot;<br>    when<br>        f: FactX ()<br>    then<br>        ResultFact resultFact = new ResultFact();<br>
        service.put(f.getName(), resultFact);<br>        insert(resultFact);<br>end</pre></div><div><br>kind regards<br>tom<br><br></div></div>