[rules-users] How to set JANINO compiler with Drools5 M5

Shigeaki Wakizaka waki41 at gmail.com
Thu Feb 26 18:01:43 EST 2009


Thanks, Mark.

It worked!
but, I had to put drools.packagebuilder.conf in the META-INF.
(I just expected that I don't have to put it, because
I wrote the config.setProperty("drools.dialect.java.compiler", "JANINO").)

Thanks, anyway.

btw, I just realized that
even though I choose JANINO, I have to put mvel.jar in the classpath.

waki.
> Shigeaki Wakizaka wrote:
>   
>> Hi.
>> I'm kind of new to Drools5.0.
>> Could I ask you guys how to set JANINO compiler with recent API?
>>
>> I just run the sample drl with EclipseIDE, which is download from drools
>> site, and then
>> the error occured- The Eclipse JDT Core jar is not in the classpath.
>> So, I just want to know why this happens and how to set another compiler
>> to retry.
>>
>>   
>>     
> Just realised that wasn't documented in drools-api any more, so I just
> updated it to the following, hopefully this answers your Q :)
> * <p>
> * Two dialects are supported, Java and MVEL. Java is the default
> dialect.<br/>
> * The Java dialect supports the following configurations:
> * <ul>
> * <li>drools.dialect.java.compiler = &lt;ECLIPSE|JANINO&gt;</li>
> * <li>drools.dialect.java.lngLevel = &lt;1.5|1.6&gt;</li>
> * </ul>
> *
> * And MVEL supports the following configurations:
> * <ul>
> * <li>drools.dialect.mvel.strict = &lt;true|false&gt;</li>
> * </ul>
> * </p>
> *
> * <p>
> * So for example if we wanted to create a new KnowledgeBuilder that used
> Janino as the default compiler we would do the following:<br/>
> * <pre>
> * KnowledgeBuilderConfiguration config =
> KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
> * config.setProperty("drools.dialect.java.compiler", "JANINO");
> * KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder( config );
> * </pre>
> * </p>
> *
> * <p>
> * Remember the KnowledgeBuilderConfiguration could have taken a
> Properties instance with that setting in it at constructor time,
> * or it could also discover from a disk based properties file too.
> * </p>
> *
>   
>> Thanks in advance.
>>
>> waki
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>   
>>     
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>   




More information about the rules-users mailing list