<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hi Toni,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I checked out the drools-verifier code. For a little acclimatization I went through a few files. Looks like Verifier.java is the main<br>
class for verifier tool. I went on to check how the Consequences are being handled but could only find the interface Consequence.java and <br>
TextConsequence.java which doesn&#39;t do too much. <br>It would be helpful to have some higher level description of the relevant class relationships. (who&#39;s who).<br>Also, it may be helpful to know how to build this code and how to run it. I checked out the code from the url: <br>

<a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-verifier/" target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-verifier/</a>&nbsp;&nbsp; but could not get any build script or instructions.<br>
<br>I hope I am going in the right direction.<br>
<br>Siddharth<div><div></div><div class="Wj3C7c"><br><br><br><br>&nbsp;<br><br><br><div class="gmail_quote">On Mon, Oct 6, 2008 at 6:56 PM, Toni Rikkola <span dir="ltr">&lt;<a href="mailto:trikkola@redhat.com" target="_blank">trikkola@redhat.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;">
Hi Siddharth<br>
<br>
Your work sounds interesting and I would like to hear more about it. Looks like your version is smarter with dependencies.<br>
<br>
The report data is used in Guvnor and in the HTML-report, but it can also be retrieved as XML or java objects.<br>
<br>
The HTML-report lists all the fields, rules and object types. So you can see what rules use certain object type and the field view shows what values are compared against the field. This dependency data is also used in the verification rules when searching for issues from the rule base.<br>


<br>
Like Mark said, the verifier is still quite blind for the RHS. Right now it just handles it as a string. So it can&#39;t really tell what objects were modified and how. This information is important to solve what rule creates or modifies facts to satisfy another rule. &nbsp;This dependency data can then again be used to find subsumption, loops ect.<br>


<br>
I hope that we can discuss about this soon.<br>
<br>
Toni<br>
<br>
Mark Proctor wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
Siddharth Angrish wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mark<br>
<br>
 &nbsp; &nbsp; I went through the RuleAnalytics Module document. It looks like there is a good compatibility between your visions of Rule Analysis and our rule dependency generation work. I&#39;ll be excited to further develop and integrate my work with drools-verifier module code.<br>


<br>
Just a short summary of how I had approached the problem:<br>
<br>
We have long ruleflow which consists of other ruleflows, ruleflow groups, split conditions. Using drools API I was<br>
able to traverse through the main ruleflow including (recursively) constituent nodes. So at any node I knew which rules<br>
are relevant. Now, to find out dependency between rules I required very intricate information about any given rule. I could not<br>
find sufficient drools APIs to get this information. There are methods to get LHS and RHS of a rule but they do not give information about individual attributes. For RHS its more worse. No textual information was availabe about it. (I am using 4.0.7 and I had even posted my questions on Drools user mailing list)<br>


<br>
 &nbsp;As a result, I wrote my own .drl file parser using javacc (which was very interesting to do) and got whatever information I required.<br>
Now I knew which rule modifies which attribute (and of which class) and which rule uses what atrributes in its conditional part. Its much easier to get dependecy sequence now. I know a few cases where this approach might produce a false dependency sequence but using other rule-flow(salience, agenda) information can help us avoid that.<br>


<br>
Now, how shall we go about it? &nbsp;I have installed irc on my system and I think I require some url to be able to connect to you guys.<br>
</blockquote>
The details of connecting with irc are here:<br>
<a href="http://www.jboss.org/drools/irc.html" target="_blank">http://www.jboss.org/drools/irc.html</a><br>
<br>
you want to speak to Rikkola online if you see him.<br>
<br>
We don&#39;t want to add another DRL parser, as we already build up an internal tree - including consequence. So in the drools-verifier you already see how we build the descr tree, although that doesn&#39;t yet have an AST for the consequence, however we have java analysier that currently does (using antlr) and this and pulls out used identifiers:<br>


<a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaExprAnalyzer.java" target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaExprAnalyzer.java</a><br>


<br>
We also extended our antlr grammar to understand the modify(...) {......} keyword. So you should be able to re-use the code inside of java expr analyzer to rewrite your existing stuff and also reusing our existing descr tree. Hopefully Toni Rikolla can help you with this online.<br>


<br>
Mark<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Siddharth<div><div></div><div><br>
<br>
On Sun, Oct 5, 2008 at 7:40 PM, Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a> &lt;mailto:<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt;&gt; wrote:<br>


<br>
 &nbsp; &nbsp;Drools 5.0 has the drools-verifier. This does a variety of<br>
 &nbsp; &nbsp;verifications and analysis, like where class fields are used, gap<br>
 &nbsp; &nbsp;analysis etc. The Guvnor BRMS can produce HTML reports for this<br>
 &nbsp; &nbsp;information. Subsumption isn&#39;t done yet, we needed to analys the<br>
 &nbsp; &nbsp;consequences for update/modify to try and detect potential<br>
 &nbsp; &nbsp;impacted rules - this is also needed to detect which rules depend<br>
 &nbsp; &nbsp;on other rules.<br>
 &nbsp; &nbsp;<a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-verifier/" target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-verifier/</a><br>
 &nbsp; &nbsp;<a href="http://wiki.jboss.org/wiki/RuleAnalyticsModule" target="_blank">http://wiki.jboss.org/wiki/RuleAnalyticsModule</a><br>
<br>
 &nbsp; &nbsp;So we would love to have your work as additions to this, &nbsp;but it<br>
 &nbsp; &nbsp;will need to be integrated with the existing drools-verifier<br>
 &nbsp; &nbsp;module code and the HTML reporting - can you make that happen? It<br>
 &nbsp; &nbsp;would be ideal, as it then means your code is part of the main<br>
 &nbsp; &nbsp;project and will be maintained and improved by the community.<br>
<br>
 &nbsp; &nbsp;Maybe you could pop onto irc, and chat to us about it more?<br>
 &nbsp; &nbsp;<a href="http://www.jboss.org/drools/irc.html" target="_blank">http://www.jboss.org/drools/irc.html</a><br>
<br>
 &nbsp; &nbsp;Do you have any visualisation plans? If on the web GWT-Diagram is<br>
 &nbsp; &nbsp;turning out to be a great tool<br>
 &nbsp; &nbsp;<a href="http://code.google.com/p/gwt-diagrams/" target="_blank">http://code.google.com/p/gwt-diagrams/</a><br>
<br>
 &nbsp; &nbsp;Mark<br>
<br>
<br>
<br>
 &nbsp; &nbsp;Sangrish wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Hi<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I have been using Drools Rules Engine in our application<br>
 &nbsp; &nbsp; &nbsp; &nbsp;for past<br>
 &nbsp; &nbsp; &nbsp; &nbsp;couple of weeks.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;One of the requirements in our project was to let a user<br>
 &nbsp; &nbsp; &nbsp; &nbsp;(anyone who is<br>
 &nbsp; &nbsp; &nbsp; &nbsp;writing/analysing the rules) find out<br>
 &nbsp; &nbsp; &nbsp; &nbsp;what other rules a given rule depends upon. There were a few<br>
 &nbsp; &nbsp; &nbsp; &nbsp;kinds of<br>
 &nbsp; &nbsp; &nbsp; &nbsp;dependencies:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;1) Object Attribute dependency: The attributes of an object<br>
 &nbsp; &nbsp; &nbsp; &nbsp;being used in<br>
 &nbsp; &nbsp; &nbsp; &nbsp;the conditional part of a rule<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;might be getting modified in the consequence part of<br>
 &nbsp; &nbsp; &nbsp; &nbsp;another rule. We<br>
 &nbsp; &nbsp; &nbsp; &nbsp;wanted all such rules with each rule having its own<br>
 &nbsp; &nbsp; &nbsp; &nbsp;dependency list.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;2) Rule Salience based dependency. A rule having lower<br>
 &nbsp; &nbsp; &nbsp; &nbsp;salience should be<br>
 &nbsp; &nbsp; &nbsp; &nbsp;executed only after a higher (if any) salience rule has<br>
 &nbsp; &nbsp; &nbsp; &nbsp;already been<br>
 &nbsp; &nbsp; &nbsp; &nbsp;executed.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;3) Dependency caused by a specific Rule flow. Rules in a<br>
 &nbsp; &nbsp; &nbsp; &nbsp;ruleflow group<br>
 &nbsp; &nbsp; &nbsp; &nbsp;should be executed only if (if any) Split condition gets<br>
 &nbsp; &nbsp; &nbsp; &nbsp;satisfied.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;4) Agenda flow dependency (i.e., one agenda following another)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;We could not find much support for this in the Drools API.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Hence we<br>
 &nbsp; &nbsp; &nbsp; &nbsp;decided to write our own dependency generator. &nbsp;The tool we<br>
 &nbsp; &nbsp; &nbsp; &nbsp;are writing<br>
 &nbsp; &nbsp; &nbsp; &nbsp;caters to first 3 dependencies. We might even handle the 4th<br>
 &nbsp; &nbsp; &nbsp; &nbsp;one. &nbsp; &nbsp;Since Drools is open source, we thought of<br>
 &nbsp; &nbsp; &nbsp; &nbsp;contributing our bit towards<br>
 &nbsp; &nbsp; &nbsp; &nbsp;its development. If the drools team wants I can happily work<br>
 &nbsp; &nbsp; &nbsp; &nbsp;with them on<br>
 &nbsp; &nbsp; &nbsp; &nbsp;getting this functionality plugged in the Drools system.<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Thanks<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Siddharth<br>
 &nbsp; &nbsp; &nbsp; &nbsp; <br>
<br>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;rules-dev mailing list<br></div></div>
 &nbsp; &nbsp;<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a>&gt;<div><br>

 &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<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>
 &nbsp;<br>
</div></blockquote>
<br>
------------------------------------------------------------------------<div><br>
<br>
_______________________________________________<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>
 &nbsp;<br>
</div></blockquote><div><div></div><div>
<br>
_______________________________________________<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>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>