Take a look at the verifier module. <br><br><div class="gmail_quote">On Tue, Feb 24, 2009 at 4:45 PM, nopea joki <span dir="ltr">&lt;<a href="mailto:nopea.joki@gmail.com">nopea.joki@gmail.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;">
David,<br>Thank you for the reply.<br> I checked the PackageDescr and RuleDescr classes, but there seems no direct methods which would return the fact classes used in the rule.<br><br>for instance if we have a rule like:<br>

<br>rule rule1<br>when <br>Person(name = &quot;qq&quot;)<br>Driver(name = &quot;aa&quot;)<br>then ... end<br><br>from this rule, I want to get [Person, Fact].<br>In org.drools.rule.Rule class, there is a getDeclaration(), this returns some type information if variable is associated with Fact class, e.g, $p: Person.<br>

But in the above case, we just get empty list of declarations.<br><br>This kind of information is useful when we need to provide a GUI for given rules.<br><br>Do you have more specific suggestion for this?<br><br>Regards,<br>
<font color="#888888">
nj</font><div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Tue, Feb 24, 2009 at 12:04 PM, David Sinclair <span dir="ltr">&lt;<a href="mailto:dsinclair@chariotsolutions.com" target="_blank">dsinclair@chariotsolutions.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;">
This should probably be in the users list, not dev. All of that information is available in the PackageDesc object. For example,<br><br>DrlParser parser = new DrlParser();<br>InputStreamReader reader = new InputStreamReader( this.getClass().getResourceAsStream( &quot;Misc3.drl&quot; ) );<br>


PackageDescr pkg = parser .parse( reader );<br><br>pkg.getGlobals();<br>pkg.getRules();<br><br>etc.<br><br><div class="gmail_quote"><div><div></div><div>On Mon, Feb 23, 2009 at 9:44 PM, nopea joki <span dir="ltr">&lt;<a href="mailto:nopea.joki@gmail.com" target="_blank">nopea.joki@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Hi,<br>I would like to get all the classes used for Facts in the rules from Package like getting global variable information from package.<br>


Is it possible to have such information?<br><br>Regards,<br><font color="#888888">nj<br>
</font><br></div></div>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>