Hi,<div><br></div><div>   Well, without knowing what you are trying to achieve, it is hard to properly advise you. :)</div><div><br></div><div>   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 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>   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( &quot;simple&quot;, info, null );</span></div>
<div><span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">  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 );
       StatefulKnowledgeSessionInfo info = inspector.getSessionInfo();
       SessionReporter.addNamedTemplate( &quot;topten&quot;, getClass().getResourceAsStream( &quot;customreports.mvel&quot; ) );
       String report = SessionReporter.generateReport( &quot;topten&quot;, info, null );</pre></span></div><div><br></div><div>   The question is: what good would do that for you? </div><div><br></div><div>    Edson<br><br>
<div class="gmail_quote">2010/6/10 Andargor <span dir="ltr">&lt;<a href="mailto:andargor@yahoo.com">andargor@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 &quot;tags&quot; 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 &quot;compiled&quot; Rete network<br>
from the KnowledgeBase (or WorkingMemory, or KnowledgeBuilder, I&#39;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 href="http://drools-java-rules-engine.46999.n3.nabble.com/Convert-rules-to-XSLT-and-dumping-Rete-Tree-to-XML-tp886380p886380.html" target="_blank">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 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>
</font></blockquote></div><br><br clear="all"><br>-- <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>