There is no "stable" API for obtaining the generated DRL. 5.2.0 introduces several debug options (see the Expert documentation), and one of them displays the generated DRL.<br><br>For earlier version, you can use:<br>
<br>import org.drools.lang.dsl.DefaultExpander;<br>import org.drools.lang.dsl.DSLTokenizedMappingFile;<br><br>DSLTokenizedMappingFile mapfile = new DSLTokenizedMappingFile();<br>DefaultExpander expander = new DefaultExpander();<br>
Reader dslReader = ...;<br>Reader dslrReader = ...;<br>String drl;<br><br>try {<br> mapfile.parseAndLoad( dslReader );<br> expander.addDSLMapping( mapfile.getMapping() );<br> drl = expander.expand( dslrReader );<br>
} catch ( IOException e ) {<br>}<br><br>-W<br><br><div class="gmail_quote">On 8 May 2011 02:20, boy18nj <span dir="ltr"><<a href="mailto:boy18nj@gmail.com">boy18nj@gmail.com</a>></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;">
I was wandering through the documentation and Google, not able to find<br>
understood able code which helps me to generate internal DRL out of DSL and<br>
DSLR. Because this helps me to clearly find out the problem with my DSL and<br>
DSLR.<br>
<br>
Please post the code which reads the DSL & DSLR from classpath and spits out<br>
DRL.<br>
<br>
<br>
Thanks in advance.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-generate-DRL-out-of-DSL-and-DSLR-tp2913960p2913960.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-generate-DRL-out-of-DSL-and-DSLR-tp2913960p2913960.html</a><br>
Sent from the Drools: User forum 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>