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.
For earlier version, you can use:
import org.drools.lang.dsl.DefaultExpander;
import org.drools.lang.dsl.DSLTokenizedMappingFile;
DSLTokenizedMappingFile mapfile = new DSLTokenizedMappingFile();
DefaultExpander expander = new DefaultExpander();
Reader dslReader = ...;
Reader dslrReader = ...;
String drl;
try {
mapfile.parseAndLoad( dslReader );
expander.addDSLMapping( mapfile.getMapping() );
drl = expander.expand( dslrReader );
} catch ( IOException e ) {
}
-W
On 8 May 2011 02:20, boy18nj <boy18nj(a)gmail.com> wrote:
I was wandering through the documentation and Google, not able to
find
understood able code which helps me to generate internal DRL out of DSL and
DSLR. Because this helps me to clearly find out the problem with my DSL and
DSLR.
Please post the code which reads the DSL & DSLR from classpath and spits
out
DRL.
Thanks in advance.
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-generate-DRL-out-of-DSL-and-DSLR...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users