[rules-users] Changing the java compiler level in drools

Stephen Masters stephen.masters at me.com
Fri Sep 14 06:10:17 EDT 2012


If you're trying to use generics in the RHS of a rule, I don't think playing with the compiler setting will help. They weren't available in DRL last time I looked.

You may be better off writing a static method on a Java class or a global object, which you can call out to. That way you can work with generics outside your DRL.

Unless anybody knows about this issue being sorted out in a newer version of Drools? :)

Steve


On 14 Sep 2012, at 05:40, "balaji.govindarajulu" <balaji.govindarajulu at yahoo.com> wrote:

> I want to change the java compiler level to 1.6 but it doesn't seem to work
> for me. I am trying to use generics in the consequence part.
> 
> Following is my code that I used to change the compiler level.
> 
> *Drools Version: 5.2.1 GA 
> JDK Version : 1.6*
> 
> *final Properties properties = new Properties();
> properties.setProperty("drools.dialect.java.compiler", "JANINO");
> properties.setProperty("drools.dialect.default", "java");
> properties.setProperty("drools.compiler.lnglevel", "1.6");
> 
> 
> PackageBuilderConfiguration packageBuilderConfiguration =
>      new PackageBuilderConfiguration(properties,(ClassLoader[]) null);
> 
> final KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory
>                .newKnowledgeBuilder(packageBuilderConfiguration);*
> 
> Let me know where I am going wrong.
> 
> Thanks for the help.
> 
> 
> 
> --
> View this message in context: http://drools.46999.n3.nabble.com/Changing-the-java-compiler-level-in-drools-tp4019770.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



More information about the rules-users mailing list