]
Adar Dembo commented on JBRULES-3349:
-------------------------------------
You can downgrade the priority of this bug; I've managed to switch over to the newer
JDT so don't need Janino support any more.
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: