Nicholas,
It seems that dialect configuration is not exposed yet through the
drools-api. We need to do that.
Would you please open a JIRA so that this is not lost?
Meanwhile, the work around is to fallback to the previous API:
JavaDialectConfiguration conf = (JavaDialectConfiguration)
((PackageBuilderConfiguration)knowledgeBuilderConfiguration).getDialectConfiguration(
"java" );
conf.setCompiler( JavaDialectConfiguration.JANINO );
Finally, please remember that JANINO does not support java 1.6. From his
project page it supports java 1.4 with a few features from 1.5.
[]s
Edson
2009/7/2 Nicholas Hemley <nic.hemley(a)sidonis.com>
Hello,
I have a little test case as follows:
*import* org.drools.builder.KnowledgeBuilderConfiguration;
*import* org.drools.builder.KnowledgeBuilderFactory;
*import* org.junit.Assert;
*import* org.junit.Test;
*public* *class* TestDrools5Config {
@Test
*public* *void* testConfig() {
KnowledgeBuilderConfiguration knowledgeBuilderConfiguration =
KnowledgeBuilderFactory.*newKnowledgeBuilderConfiguration*();
knowledgeBuilderConfiguration.setProperty(
"drools.dialect.java.compiler", "JANINO");
knowledgeBuilderConfiguration.setProperty(
"drools.dialect.java.lngLevel", "1.6");
String droolsDialectJavaCompiler =
knowledgeBuilderConfiguration.getProperty("drools.dialect.java.compiler");
System.*out*.println("droolsDialectJavaCompiler=" +
droolsDialectJavaCompiler);
Assert.*assertNotNull*(droolsDialectJavaCompiler);
String *droolsDialectJavaLngLevel* =
knowledgeBuilderConfiguration.getProperty("drools.dialect.java.lngLevel");
System.*out*.println("drools.dialect.java.lngLevel=" +
droolsDialectJavaLngLevel);
Assert.*assertNotNull*(droolsDialectJavaLngLevel);
}
}
It fails.
I have seen the post for using JANINO with Drools:
http://lists.jboss.org/pipermail/rules-users/2009-February/008089.html
Yet this does not explain my test case failing – any ideas.
It appears as if it is not possible to set JANINO programmatically, only
via properties.conf, etc. which I don’t want to do(!)
Cheerio,
Nic Hemley
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com