[rules-users] How to generate DRL out of DSL and DSLR?

Wolfgang Laun wolfgang.laun at gmail.com
Sun May 8 03:18:05 EDT 2011


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 at 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-tp2913960p2913960.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110508/65d80e0c/attachment.html 


More information about the rules-users mailing list