<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I'm using Drool 5.&nbsp; I reviewed globals and it looks like it might be appropriate for my situation.&nbsp; I find plenty of documentation on how to use a global in a consequence, but none on how to use a global in a condition.&nbsp; Do you know if it's possible to use a global in a condition?&nbsp; My situation is that I need to check a container class to see if the container is filled, if not then fill the container (the condition would actually be more elaborate and include facts but I'm omitting them for the sake of brevity).&nbsp; The DRL file would look something like this (the example doesn't work of course):<br><br><br>global com.example.Container globalContainer;<br><br>rule "container full rule"<br>&nbsp; when<br>&nbsp;&nbsp;&nbsp; globalContainer.getContentsFlag() == false<br>&nbsp; then<br>&nbsp;&nbsp;&nbsp; globalContainer.fill(new
 ContainerContents());<br>&nbsp;&nbsp;&nbsp; globalContainer.setContentsFlag(true);<br><br><br>--- On <b>Fri, 7/29/11, Esteban Aliverti <i>&lt;esteban.aliverti@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Esteban Aliverti &lt;esteban.aliverti@gmail.com&gt;<br>Subject: Re: [rules-users] How to add application data via StatefulKnowledgeSession<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Friday, July 29, 2011, 3:51 AM<br><br><div id="yiv2096723793">Which version of drools are you using? The document you pointed out seems a little bit old.<div>Since Drools 5, you can use globals to use application's data in your DRLs.</div><div>If you are using Drools 5 or higher, I suggest you to read the documentation about globals.</div>

<div><br></div><div>Best Regards,&nbsp;<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a rel="nofollow" target="_blank" href="http://www.plugtree.com">http://www.plugtree.com </a><br>- Blog @ <a rel="nofollow" target="_blank" href="http://ilesteban.wordpress.com">http://ilesteban.wordpress.com</a><br>


<br><br><div class="yiv2096723793gmail_quote">2011/7/28 Matthew Erler <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:wires8@yahoo.com" target="_blank" href="/mc/compose?to=wires8@yahoo.com">wires8@yahoo.com</a>&gt;</span><br><blockquote class="yiv2096723793gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit;" valign="top"><div>Can someone please show me an example where application data is added to<br>workingMemory as described here:<br><a rel="nofollow" target="_blank" href="http://docs.codehaus.org/display/DROOLS/Application+Data">http://docs.codehaus.org/display/DROOLS/Application+Data</a> using<br>

StatefulKnowledgeSession?</div>
<div>I have a need to populate an object from a rules file and I don't want that<br>object itself to be treated as a rule.&nbsp; All the examples I can find refer to<br>the use of ruleBase to get workingMemory.&nbsp; My code utilizes<br>

StatefulKnowledgeSession to fire rules and I don't see how to get ruleBase<br>or workingMemory from it.&nbsp; Thanks.</div></td></tr></tbody></table><br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></div></blockquote></td></tr></table>