<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 17/02/2012 05:37, <a class="moz-txt-link-abbreviated" href="mailto:GPatel@tsys.com">GPatel@tsys.com</a> wrote:
<blockquote
cite="mid:OFB21AF9DD.83F446DC-ON072579A7.001EC1E7-072579A7.001EDC30@tsys.com"
type="cite"><font face="sans-serif" size="2">I need it at rule
definition time, or when
the rule is saved. Could you point me to a starting place in the
internal
api ?</font>
<br>
</blockquote>
take a look in drools-compiler and org.drools.lang.RuleParserTest.<br>
<br>
Mark<br>
<blockquote
cite="mid:OFB21AF9DD.83F446DC-ON072579A7.001EC1E7-072579A7.001EDC30@tsys.com"
type="cite">
<br>
<font face="sans-serif" size="2">Thanks</font>
<br>
<font face="sans-serif" size="2">G. Patel</font>
<br>
<br>
<br>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">From:
</font><font face="sans-serif" size="1">Mark Proctor
<a class="moz-txt-link-rfc2396E" href="mailto:mproctor@codehaus.org"><mproctor@codehaus.org></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">To:
</font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Date:
</font><font face="sans-serif" size="1">02/16/2012 10:06 PM</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Subject:
</font><font face="sans-serif" size="1">Re: [rules-users]
Rule definition introspection</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Sent by:
</font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a></font>
<br>
<hr noshade="noshade">
<br>
<br>
<br>
<font size="3">On 17/02/2012 01:11, </font><a
moz-do-not-send="true" href="mailto:GPatel@tsys.com"><font
color="blue" size="3"><u>GPatel@tsys.com</u></font></a><font
size="3">
wrote: </font>
<br>
<font face="sans-serif" size="2">Is it possible to self-introspect
the
rule definition?</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
For example:</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
when</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
$redCar : Car(color == 'red')</font><font size="3">
</font><font face="sans-serif" size="2"><br>
then</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
System.out.println("a red car exists");</font><font
size="3">
<br>
</font><font face="sans-serif" size="2"><br>
Is it possible to know that the above rule uses the Car fact and
the Car.color
attribute?</font><font size="3"> </font>
<br>
<font size="3">Yes, but you'll need to dig into internal apis. If
you
are doing this at runtime just start introspecting the rule
object to get
an idea of all the internal data structures.<br>
<br>
Mark</font>
<br>
<font face="sans-serif" size="2"><br>
Thanks</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
G. Patel</font><font size="3">
-----------------------------------------
The information contained in this communication (including any
attachments
hereto) is confidential and is intended solely for the personal
and confidential
use of the individual or entity to whom it is addressed. If the
reader
of this message is not the intended recipient or an agent
responsible for
delivering it to the intended recipient, you are hereby notified
that you
have received this communication in error and that any review,
dissemination,
copying, or unauthorized use of this information, or the taking
of any
action in reliance on the contents of this information is
strictly prohibited.
If you have received this communication in error, please notify
us immediately
by e-mail, and delete the original message. Thank you <br>
</font>
<br>
<tt><font size="3">_______________________________________________<br>
rules-users mailing list<br>
</font></tt><a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org"><tt><font color="blue"
size="3"><u>rules-users@lists.jboss.org</u></font></tt></a><tt><font
size="3"><br>
</font></tt><a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font
color="blue" size="3"><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></tt></a><tt><font
size="3"><br>
</font></tt>
<br>
<tt><font size="2">_______________________________________________<br>
rules-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
</font></tt><a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font
size="2">https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font
size="2"><br>
</font></tt>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>