<div><br></div> Take a look at the org.drools.rule.JavaDialectRuntimeData class in drools-core. It contains a Map field called "store". All bytecode generated is stored in there, but there is no built-in way of dumping it. So either your tool allows you to inspect it in memory, or you change the class to dump it somewhere. Take a look at the writeExternal() method to understand how we dump it during kbase serialization.<div>
<br></div><div> Edson<br><br><div class="gmail_quote">2012/1/28 Mainul Raju <span dir="ltr"><<a href="mailto:mainul.raju@yahoo.com">mainul.raju@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span><br></span></div><div><span>Thanks a lot. At least we are on the same track :). </span></div><div><span><br></span></div><div><span>I already dumped it into a directory and It gives me all generated .java files. At this point, trying to figure out some ways around for static analysis on rules by using SOOT. No luck yet :( . </span></div>
<div><span><br></span></div><div><span>Thanks again for your informative response.</span></div><div> </div><div><font color="#a2a2a2">----------</font></div><div><font color="#a2a2a2">Mainul</font></div><div><br></div> <div style="font-size:10pt;font-family:arial,helvetica,sans-serif">
<div style="font-size:12pt;font-family:'times new roman','new york',times,serif"> <div dir="ltr"> <font face="Arial"> <hr size="1"> <b><span style="font-weight:bold">From:</span></b> Edson Tirelli <<a href="mailto:ed.tirelli@gmail.com" target="_blank">ed.tirelli@gmail.com</a>><br>
<b><span style="font-weight:bold">To:</span></b> Rules Users List <<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>> <br> <b><span style="font-weight:bold">Sent:</span></b> Friday, 27 January 2012, 17:35<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [rules-users] bytecode representation of rules<br> </font> </div><div><div class="h5"> <br><div><div><br></div> Tough question to answer as not everything in a DRL file becomes bytecode, and not all in the same place. For instance, rule consequences and other semantic code blocks, when using the java dialect, will become a class that is code generated and compiled in memory. You can see that code by setting the dump dir option in the KnowledgeBuilderConfiguration object (or -Ddrools.dump.dir=<path> on the command line). <div>
<br></div><div> Constraints on the other hand will become a mix of JIT bytecode and/or MVEL expressions and/or object accessors, depending on several factors. Since they are shared among multiple rules, they don't belong to a single rule in particular, but become part of the Rete network, that is basically an in-memory data structure.</div>
<div><br></div><div> Not exactly sure if this helps you...</div><div><br></div><div> Edson<br><br><div>2012/1/26 Mainul Raju <span dir="ltr"><<a rel="nofollow" href="mailto:mainul.raju@yahoo.com" target="_blank">mainul.raju@yahoo.com</a>></span><br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span> <br></span></div><div><span><br></span></div>
<div><span>Hello All:</span></div><div><span><br></span></div><div><span>I have been trying to get the byte code representation of rules (.drl files). I would appreciate it if anyone could kindly provide me any way to do that.</span></div>
<div><span> </span></div><div><span>I have created a rule based application with 100 rules in 5 different .drl files. My intention is to analyze the application with some byte code analyzer (i.e. soot). For the purpose of hat static analysis, I need the byte-code representation of rules which I can't get from drools.</span></div>
<div><span><br></span></div><div><span>Thanks in advance.</span></div><div><span>//</span></div><span><font color="#888888"><div><span>Mainul<br></span></div></font></span></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a rel="nofollow" href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div>
</div><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br><br> </div></div></div> </div> </div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto: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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>