Drools 5.5.0
Indenting the "template header" or "rule" keywords in a template file
will
cause exceptions on expansion. I believe it might be related to this old
JIRA issue:
https://issues.jboss.org/browse/JBRULES-2786
"DecisionTableParseException" and "NullPointerException" are thrown.
See
example code and related stack traces below.
Is this a bug in drools or is the template formatting intended to be this
strict? Or am I doing something else wrong?
=====================
Indented template header:
" 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)
at
org.drools.template.parser.DefaultTemplateContainer.<init>(DefaultTemplateContainer.java:47)
at
org.drools.decisiontable.ExternalSpreadsheetCompiler.compile(ExternalSpreadsheetCompiler.java:97)
=====================
Indented rule keyword:
" rule "Cheese fans_(a){row.rowNumber}"
when
Person(age == @{age})"
Gives the exception:
java.lang.NullPointerException
at
org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:67)
at
org.drools.template.parser.DefaultTemplateColumn.addCondition(DefaultTemplateColumn.java:90)
at
org.drools.template.parser.DefaultTemplateRuleBase.createColumnConditions(DefaultTemplateRuleBase.java:103)
at
org.drools.template.parser.DefaultTemplateRuleBase.createTemplateRule(DefaultTemplateRuleBase.java:96)
at
org.drools.template.parser.DefaultTemplateRuleBase.getDTRules(DefaultTemplateRuleBase.java:83)
at
org.drools.template.parser.DefaultTemplateRuleBase.<init>(DefaultTemplateRuleBase.java:62)
at
org.drools.template.parser.TemplateDataListener.<init>(TemplateDataListener.java:74)
at
org.drools.decisiontable.ExternalSpreadsheetCompiler.compile(ExternalSpreadsheetCompiler.java:99)
--
View this message in context:
http://drools.46999.n3.nabble.com/Why-are-indented-keywords-in-template-c...
Sent from the Drools: User forum mailing list archive at
Nabble.com.