<HTML><BODY>
Hello thanks for the quick and precise answer!<div><br></div><div>I believe that the time difference will be a bit of a problem for the IRC chat , but i will be online (channel: #drools user: igrachev) today and will try to check it often.</div><div>However big thanks for the support and the willingness to help!</div><div><br></div><div>You are saying that the code is there, but is not public and documented. Well being not public seems to be a problem, but do you</div><div>think it is possible to give me an example with the official Drools "first rule" - Sample.drl. The one that comes with the first Drools project.</div><div>So do you believe it will be possible to paste me some code on how to retrieve the information that this ruleset is using one fact of type Message</div><div>and two of it's attributes - <i>status </i>and <i>message. </i>So just some code in a public static void main (String [] args) will be great :), or any kind of</div><div>explanation :).</div><div><br></div><div>Once again thank you.</div><div><br></div><div>Have a nice day,<br>Milen<br><br><br><br>----Original Letter----<br>From: Mark Proctor mproctor@codehaus.org
<br>About: Re: [rules-users] Is rule introspection available from the Drools
        API?
<br>To: Rules Users List &lt;rules-users@lists.jboss.org&gt;
<br>Sent at: Monday, 2014, January 6 16:05:33 EET
<br><br>The code is there, but it’s not public and not documented, and the code can be a little hard to understand - as it’s grown organically over the years.<br>
<br>
You’ll need to cast and unwrap and look at member vars. Start on the Rule and the lhs variable. You can always pop onto irc, with live questions,and we’ll try and respond quickly.<br>
<a href="http://www.jboss.org/drools/irc" target="_blank">http://www.jboss.org/drools/irc</a><br>
<br>
Mark<br>
<br>
On 6 Jan 2014, at 09:51, milen igrachev &lt;<a href="javascript: internSendMess('igrachev@abv.bg')">igrachev@abv.bg</a>&gt; wrote:<br>
<br>
&gt; Hello,<br>
&gt; is there a way to introspect a Drools file from within java code?<br>
&gt; What I need is to be able to identify the facts and the fact attributes that are used in a given DRL file.<br>
&gt; <br>
&gt; For example if I have a rule stored in a customer.drl DRL file within my project, containing the following definition:<br>
&gt; package myRulePackage<br>
&gt; <br>
&gt; import org.rules.model.Customer<br>
&gt; import org.rules.model.Mambership<br>
&gt; <br>
&gt; rule "is eligible customer"<br>
&gt;         when<br>
&gt;                 $c:Customer(status == "active")<br>
&gt;                 Membership(customer == $c, type == "premium")<br>
&gt;         then<br>
&gt;                 $c.setEligibilityStatus(true);<br>
&gt; end<br>
&gt; <br>
&gt; What i need is a way to understand that this ruleset customer.drl is using two fact types - Customer and Membership and three of their attributes - Customer.status, Membership.customer and Membership.type.<br>
&gt; <br>
&gt; <br>
&gt; I found some information on the internet that such functionality is not supported, however the information was a bit too old, so I decided to ask again.<br>
&gt; <br>
&gt; <br>
&gt; Big thanks for the support!<br>
&gt; Milen<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="javascript: internSendMess('rules-users@lists.jboss.org')">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="javascript: internSendMess('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></BODY></HTML>