Line separators in spreadsheet are escaped in RHDM 7.3 / 7.4

Solution Unverified - Updated -

Issue

  • After upgrading to RHDM 7.3.0, it throws errors on spreadsheet (.xls) build
line 1:15 no viable alternative at character '\'
line 1:29 no viable alternative at character '\'
line 1:47 no viable alternative at character '\'
line 2:13 no viable alternative at character '\'
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.63 s <<< FAILURE! - in org.drools.decisiontable.LineBreakXLSTest
[ERROR] testMultipleLinesInAction(org.drools.decisiontable.LineBreakXLSTest)  Time elapsed: 0.257 s  <<< ERROR!
java.lang.NullPointerException
    at java.lang.String.indexOf(String.java:1718)
    at org.drools.compiler.rule.builder.dialect.DialectUtil.rewriteModifyDescr(DialectUtil.java:631)
    at org.drools.compiler.rule.builder.dialect.DialectUtil.rewriteDescr(DialectUtil.java:580)
    at org.drools.compiler.rule.builder.dialect.DialectUtil.fixBlockDescr(DialectUtil.java:161)
    at org.drools.compiler.rule.builder.dialect.DialectUtil.fixBlockDescr(DialectUtil.java:119)
    at org.drools.compiler.rule.builder.dialect.asm.AbstractASMConsequenceBuilder.consequenceContext(AbstractASMConsequenceBuilder.java:57)
    at org.drools.compiler.rule.builder.dialect.asm.AbstractASMConsequenceBuilder.build(AbstractASMConsequenceBuilder.java:33)
    at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:126)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.internalAddRule(KnowledgeBuilderImpl.java:1204)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addRule(KnowledgeBuilderImpl.java:1195)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRulesLevel(KnowledgeBuilderImpl.java:1173)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRules(KnowledgeBuilderImpl.java:1121)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileKnowledgePackages(KnowledgeBuilderImpl.java:946)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addPackage(KnowledgeBuilderImpl.java:937)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addPackageFromDecisionTable(KnowledgeBuilderImpl.java:371)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addKnowledgeResource(KnowledgeBuilderImpl.java:759)
    at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:2288)
    at org.drools.decisiontable.LineBreakXLSTest.testMultipleLinesInAction(LineBreakXLSTest.java:53)
    ...
  • Checked with SpreadSheetCompiler, the generated DRL is like this. All line separators in ACTION column are escaped and resulted in "\n".
rule "multiple lines in action_12"
    when
        $fact:Person(name == "John")
    then
        modify($fact){\n setAge(30),\n setAlive(false)\n}
        /* DEBUG */\nSystem.out.println("  **  " +drools.getRule().getName() + ", $fact = " + $fact);
end
  • After upgrading to RHDM 7.4.0, unexpected line separator escape on spreadsheet (.xls) build is still observed

Environment

  • Red Hat Decision Manager
    • 7.3.0
    • 7.4.0
  • Using Spreadsheet (xls/xlsx) and ACTION columns have line separator (So written in multi lines)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In