<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Siddharth Angrish wrote:
<blockquote
 cite="mid:e951f7090810052255n63033a7dpe794032013789327@mail.gmail.com"
 type="cite">
  <div dir="ltr">Hi Mark<br>
  <br>
&nbsp;&nbsp;&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'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>
  </div>
</blockquote>
The details of connecting with irc are here:<br>
<a moz-do-not-send="true" 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'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'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 class="moz-txt-link-freetext" href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaExprAnalyzer.java">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>
<blockquote
 cite="mid:e951f7090810052255n63033a7dpe794032013789327@mail.gmail.com"
 type="cite">
  <div dir="ltr"><br>
Siddharth<br>
  <br>
  <div class="gmail_quote">On Sun, Oct 5, 2008 at 7:40 PM, Mark Proctor
  <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</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;">Drools
5.0 has the drools-verifier. This does a variety of verifications and
analysis, like where class fields are used, gap analysis etc. The
Guvnor BRMS can produce HTML reports for this information. Subsumption
isn't done yet, we needed to analys the consequences for update/modify
to try and detect potential impacted rules - this is also needed to
detect which rules depend on other rules.<br>
    <a moz-do-not-send="true"
 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>
    <a moz-do-not-send="true"
 href="http://wiki.jboss.org/wiki/RuleAnalyticsModule" target="_blank">http://wiki.jboss.org/wiki/RuleAnalyticsModule</a><br>
    <br>
So we would love to have your work as additions to this, &nbsp;but it will
need to be integrated with the existing drools-verifier module code and
the HTML reporting - can you make that happen? It would be ideal, as it
then means your code is part of the main project and will be maintained
and improved by the community.<br>
    <br>
Maybe you could pop onto irc, and chat to us about it more?<br>
    <a moz-do-not-send="true"
 href="http://www.jboss.org/drools/irc.html" target="_blank">http://www.jboss.org/drools/irc.html</a><br>
    <br>
Do you have any visualisation plans? If on the web GWT-Diagram is
turning out to be a great tool<br>
    <a moz-do-not-send="true"
 href="http://code.google.com/p/gwt-diagrams/" target="_blank">http://code.google.com/p/gwt-diagrams/</a><br>
    <font color="#888888"><br>
Mark</font>
    <div>
    <div class="Wj3C7c"><br>
    <br>
    <br>
Sangrish 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<br>
      <br>
&nbsp; &nbsp; &nbsp;I have been using Drools Rules Engine in our application for past<br>
couple of weeks.<br>
One of the requirements in our project was to let a user (anyone who is<br>
writing/analysing the rules) find out<br>
what other rules a given rule depends upon. There were a few kinds of<br>
dependencies:<br>
1) Object Attribute dependency: The attributes of an object being used
in<br>
the conditional part of a rule<br>
&nbsp; might be getting modified in the consequence part of another rule. We<br>
wanted all such rules with each rule having its own dependency list.<br>
2) Rule Salience based dependency. A rule having lower salience should
be<br>
executed only after a higher (if any) salience rule has already been<br>
executed.<br>
3) Dependency caused by a specific Rule flow. Rules in a ruleflow group<br>
should be executed only if (if any) Split condition gets satisfied.<br>
4) Agenda flow dependency (i.e., one agenda following another) <br>
&nbsp; We could not find much support for this in the Drools API. Hence we<br>
decided to write our own dependency generator. &nbsp;The tool we are writing<br>
caters to first 3 dependencies. We might even handle the 4th one. &nbsp;
&nbsp;Since Drools is open source, we thought of contributing our bit towards<br>
its development. If the drools team wants I can happily work with them
on<br>
getting this functionality plugged in the Drools system.<br>
      <br>
      <br>
Thanks<br>
Siddharth<br>
&nbsp;<br>
    </blockquote>
    <br>
    </div>
    </div>
    <div>
    <div class="Wj3C7c">_______________________________________________<br>
rules-dev mailing list<br>
    <a moz-do-not-send="true" href="mailto:rules-dev@lists.jboss.org"
 target="_blank">rules-dev@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 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>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>