[jboss-jira] [JBoss JIRA] (JBRULES-3349) Not possible to use Janino to compile templates

Adar Dembo (JIRA) jira-events at lists.jboss.org
Mon Jan 16 22:23:18 EST 2012


Adar Dembo created JBRULES-3349:
-----------------------------------

             Summary: Not possible to use Janino to compile templates
                 Key: JBRULES-3349
                 URL: https://issues.jboss.org/browse/JBRULES-3349
             Project: Drools
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: drools-compiler
    Affects Versions: 5.3.1.Final
            Reporter: Adar Dembo
            Assignee: Mark Proctor


I've got the following code in my program:

{code}
Properties props = new Properties();
props.setProperty("drools.dialect.java.compiler", "JANINO");
config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props);
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(config);
{code}

The resulting KnowledgeBuilder compiles rules using the Janino compiler, which is important for me because I have an old JDT dependency that may not be updated.

Now I'm trying to compile templates, and I've got the following code, based on the Drools documentation:

{code}
ObjectDataCompiler converter = new ObjectDataCompiler();
InputStream templateStream = this.getClass().getResourceAsStream("Templates.drl");
String compiledTemplate = converter.compile(clusters, templateStream);
Reader compiledRules = new StringReader(compiledTemplate);
...
kbuilder.add(ResourceFactory.newReaderResource(compiledRules), ResourceType.DRL);
{code}

Unfortunately, I see the [familiar JDT error|https://community.jboss.org/wiki/RulesTomcat] in converter.compile(), indicating that Janino is not being used for template compilation. I've spent a bit of time going through the source code and I don't see a way to do this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list