A new line character between the last parameter and ");" in a method call causes a build error in executable model.

Solution Unverified - Updated -

Issue

Building a rule which is written in MVEL dialect and contains a new line character between the last parameter and ); in a method call in executable model, a model generation failure occurs.

For example, when I build a rule which contains a method call statement with a new line character between (*1) and (*2) with executable rule models enabled,

package com.example.reproducer

dialect "mvel"

rule "rule4a2"
    when
        $fact : Fact()
    then
        $fact.method2("message1", "message2"    // ..... (*1)
);                                              // ..... (*2)
end

an error like below occurs.

$ mvn clean compile -DgenerateModel=YES
...
[INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) @ reproducer_model_compiler_4a ---
...
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_model_compiler_4a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed: (line 0,col 0) Parse error. Found "\n", expected one of  "!=" "%" "%=" "&" "&&" "&=" ")" "*" "*=" "+" "+=" "," "-" "-=" "->" "/" "/=" "::" "<" "<<=" "<=" "=" "==" ">" ">=" ">>=" ">>>=" "?" "^" "^=" "instanceof" "|" "|=" "||"
...

This issue occurs when the method takes two or more parameters but does not occur when the method takes only one parameter.

Environment

  • Red Hat Decision Manager (RHDM)
    • 7.5.0 - 7.9.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content