[rules-dev] [drools] Fixing issue where indented keywords would fail template expansion. (#170)
Mark Proctor
mproctor at codehaus.org
Sun Jan 13 13:48:54 EST 2013
I just don't think drools-templates is needed. Everything you could need for tempting is provided by MVEL templating, out of the box. If I was writing a system that needed templating, I would just use MVEL, not drools-template.
drools-templates tries to bring templating to decision tables, and this is where the complexity starts. It was a nice idea, but it needed someone to keep improving the architecture. It's now redundant as Michael already has an alternative way to do templating with decision tables and the guided editor, in the web UI. This really leaves no place now for drools-templates, but we don't yet have a strategy for killing it, because templating and xls decision tables are unfortunately coupled together. So I can't kill drools-templates without killing xls support; another reason why I don't like drools-templates.
Mark
On 13 Jan 2013, at 17:58, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
> Even though I added some classes to the template package, my heart
> never really was in it. I'm sure some considerably more powerful
> implementations for template driven text generation are available
> out there, and if this feature needs to be continued, basing it on
> such a package would be far better than stumbling along with the
> current solution.
>
> -W
>
> On 13/01/2013, Mark Proctor <mproctor at codehaus.org> wrote:
>> If it's low risk go ahead and apply it.
>>
>> drools-templates may not be continued in 6.x series though. Espeically if we
>> can get the xls simply as an import/export of the current web based tooling.
>> Drools-template is a community contribution code dump, the contributor did
>> not maintain it further, it's quite complicated for what it is and no one
>> else seems to want to touch it. In hindsight we should not have allowed the
>> contribution.
>>
>>
>> Mark
>> On 11 Jan 2013, at 20:42, Michael Anstis <michael.anstis at gmail.com> wrote:
>>
>>> Anybody care if I merge this pull request? I was involved with the
>>> original emails on drools-user.
>>>
>>> It'd be a shame to let (new?) community involvement slip by.
>>>
>>> sent on the move
>>>
>>> ---------- Forwarded message ----------
>>> From: "magnusvojbacke" <notifications at github.com>
>>> Date: 22 Dec 2012 15:39
>>> Subject: [drools] Fixing issue where indented keywords would fail template
>>> expansion. (#170)
>>> To: "droolsjbpm/drools" <drools at noreply.github.com>
>>>
>>>
>>> Issue description
>>>
>>> In template files, whitespaces before keywords would cause exceptions.
>>>
>>> Example of indented "template" keyword
>>>
>>> template header
>>> age
>>> type
>>> log
>>>
>>> Gives the exception:
>>> org.drools.template.parser.DecisionTableParseException: Missing header
>>> at
>>> org.drools.template.parser.DefaultTemplateContainer.parseTemplate(DefaultTemplateContainer.java:87)
>>>
>>> Example of indented "rule" keyword
>>>
>>> rule "Cheese fans_@{row.rowNumber}"
>>> when
>>> Person(age == @{age})
>>>
>>> Gives the exception:
>>> java.lang.NullPointerException
>>> at
>>> org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:67)
>>>
>>> Patch description
>>>
>>> Altered the DefaultTemplateContainer.java to trim lines before
>>> comparison.
>>> Added simple unit-test to expose bug / confirm patch
>>> You can merge this Pull Request by running:
>>>
>>> git pull https://github.com/magnusvojbacke/drools
>>> templates_indented_keywords
>>> Or view, comment on, or merge it at:
>>>
>>> https://github.com/droolsjbpm/drools/pull/170
>>>
>>> Commit Summary
>>>
>>> Fixing issue where indented keywords would fail template expansion.
>>> File Changes
>>>
>>> M
>>> drools-templates/src/main/java/org/drools/template/parser/DefaultTemplateContainer.java
>>> (17)
>>> M
>>> drools-templates/src/test/java/org/drools/template/parser/DefaultTemplateContainerTest.java
>>> (11)
>>> A drools-templates/src/test/resources/templates/rule_template_indented.drl
>>> (35)
>>> Patch Links
>>>
>>> https://github.com/droolsjbpm/drools/pull/170.patch
>>> https://github.com/droolsjbpm/drools/pull/170.diff
>>> —
>>> Reply to this email directly or view it on GitHub.
>>>
>>>
>>>
>>> _______________________________________________
>>> rules-dev mailing list
>>> rules-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
More information about the rules-dev
mailing list