<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks for the quick response! I've managed to take a quick look at the output, and it is indeed verbose. I will definitely take a look at what good it can do. :)<br><br><br>--- On <b>Thu, 6/10/10, Edson Tirelli <i>&lt;tirelli@post.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Edson Tirelli &lt;tirelli@post.com&gt;<br>Subject: Re: [rules-users] Convert rules to XSLT and dumping Rete Tree to XML<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Thursday, June 10, 2010, 12:11 PM<br><br><div id="yiv1082623824">&nbsp;&nbsp; Hi,<div><br></div><div>&nbsp;&nbsp; Well, without knowing what you are trying to achieve, it is hard to properly advise you. :)</div><div><br></div><div>&nbsp;&nbsp; It is possible to dump the Rete Tree, among other ways, by using a
 reporting framework I added for debugging. Example code here:</div>
<div><br></div><div><a rel="nofollow" target="_blank" href="https://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/util/debug/SessionInspectorTest.java">https://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/util/debug/SessionInspectorTest.java</a></div>
<div><br></div><div>&nbsp;&nbsp; Basically, for an existing session, do:</div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;"><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;">        SessionInspector inspector = new SessionInspector( ksession );</span></div>
<div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;"></span><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;">        StatefulKnowledgeSessionInfo info = inspector.getSessionInfo();</span></div>
<div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;"></span><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap;">        String report = SessionReporter.generateReport( "simple", info, null );</span></div>
<div><span class="Apple-style-span" style="font-size: medium;"><pre style="word-wrap: break-word; white-space: pre-wrap;"> &nbsp;You can create your own reports using MVEL templates and use them. Example:</pre>
<pre style="word-wrap: break-word; white-space: pre-wrap;">       SessionInspector inspector = new SessionInspector( ksession );<br>       StatefulKnowledgeSessionInfo info = inspector.getSessionInfo();<br>       SessionReporter.addNamedTemplate( "topten", getClass().getResourceAsStream( "customreports.mvel" ) );<br>       String report = SessionReporter.generateReport( "topten", info, null );</pre></span></div><div><br></div><div>&nbsp;&nbsp; The question is: what good would do that for you?&nbsp;</div><div><br></div><div>&nbsp;&nbsp; &nbsp;Edson<br><br>
<div class="gmail_quote">2010/6/10 Andargor <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:andargor@yahoo.com" target="_blank" href="/mc/compose?to=andargor@yahoo.com">andargor@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Hello, first time on this list, be gentle :)<br>
<br>
I need to convert DRL/DSLR rules to XSLT. There are many reasons why this is<br>
necessary, but I would rather not get into that.<br>
<br>
The rules themselves are very simple presence/absence of "tags" and simple<br>
numeric comparisons (all easily converted to XSLT), and the rule base is<br>
acyclic. The RHS does not contain anything other than insertLogicals.<br>
<br>
I can already perform a topological sort of the rules and output XSLT.<br>
However, it gets messy because of the differing approach from Drools and I<br>
was wondering if I could somehow dump to XML the "compiled" Rete network<br>
from the KnowledgeBase (or WorkingMemory, or KnowledgeBuilder, I'm not<br>
sure). That way i think I can make the XSLT simpler and cleaner by using a<br>
more hierarchical approach to the statements.<br>
<br>
There used to be Dumper and ReteDumper classes to do this in the past, but<br>
looking at the source they seem to have disappeared.<br>
<br>
Can someone give me a few pointers on dumping the Rete Tree to XML?<br>
<font color="#888888">--<br>
View this message in context: <a rel="nofollow" target="_blank" href="http://drools-java-rules-engine.46999.n3.nabble.com/Convert-rules-to-XSLT-and-dumping-Rete-Tree-to-XML-tp886380p886380.html">http://drools-java-rules-engine.46999.n3.nabble.com/Convert-rules-to-XSLT-and-dumping-Rete-Tree-to-XML-tp886380p886380.html</a><br>

Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss by Red Hat @ <a rel="nofollow" target="_blank" href="http://www.jboss.com">www.jboss.com</a><br>
</div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></blockquote></td></tr></table><br>