KnowledgePackageImp and org.drools.rulePackage are not in the <br>&quot;stable&quot; part of the API, but this is how:<br><br>KnowledgePackage kPackage = ...;<br>KnowledgePackageImp kPackageImp = (KnowledgePackageImp)kPackage;<br>
org.drools.rule.Package package_ = kPackageImp.pkg;<br><br>// globals: key is name, value is type name<br>Map&lt;String, String&gt; name2global = package_.getGlobals();<br><br>I have frequently urged for everything that can be written in DRL to be<br>
accessible though the &quot;stable&quot; API. It can&#39;t be &quot;unstable&quot; if it is in the<br>DRL language, right?<br><br>-W<br><br><br><div class="gmail_quote">2011/2/9 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Mark, Edson, (Wolfgang?)<br><br>Any public API to ascertain whether a DRL package needs a global to be inserted?<br>
<br>E.G. a DRL has global defined within it, the DRL is loaded into a KnowledgePackage, can you introspect the package to find out if it contains a global, it&#39;s datatype and name?<br>
<br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">On 9 February 2011 17:10, gs76pl <span dir="ltr">&lt;<a href="mailto:gstasica@pacemetrics.com" target="_blank">gstasica@pacemetrics.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
yeah,,, thats exactly what i need<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/how-to-check-if-a-global-has-been-declared-in-a-rule-tp2459143p2459883.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/how-to-check-if-a-global-has-been-declared-in-a-rule-tp2459143p2459883.html</a><br>


</font><div><div></div><div>Sent from the Drools - User mailing list archive at Nabble.com.<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>
</div></div></blockquote></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>