Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1542

Binding a list written in MVEL expression causes a build error in executable model.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.1.0.GA, 7.9.0.GA
    • 7.10.1.GA
    • BRE
    • This issue is reproducible on all releases from RHDM 7.1.0 to 7.9.0.

    • CR1
    • Hide
      $ unzip reproducer_model_compiler_12a.zip
      $ cd reproducer_model_compiler_12a
      $ mvn clean compile exec:exec -DgenerateModel=YES
      ...
      [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_model_compiler_12a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed: Encountered unexpected token: "[" "["
      [ERROR]     at line 1, column 10.
      [ERROR] 
      [ERROR] Was expecting one of:
      [ERROR] 
      [ERROR]     "+"
      [ERROR]     "++"
      [ERROR]     "-"
      [ERROR]     "--"
      [ERROR] 
      [ERROR] Problem stacktrace : 
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.generateParseException(GeneratedMvelParser.java:12225)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.jj_consume_token(GeneratedMvelParser.java:12070)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.UnaryExpression(GeneratedMvelParser.java:2541)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.MultiplicativeExpression(GeneratedMvelParser.java:2446)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.AdditiveExpression(GeneratedMvelParser.java:2408)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.ShiftExpression(GeneratedMvelParser.java:2372)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.RelationalExpression(GeneratedMvelParser.java:2322)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.InstanceOfExpression(GeneratedMvelParser.java:2303)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.EqualityExpression(GeneratedMvelParser.java:2265)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.AndExpression(GeneratedMvelParser.java:2243)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.ExclusiveOrExpression(GeneratedMvelParser.java:2222)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.InclusiveOrExpression(GeneratedMvelParser.java:2201)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.ConditionalAndExpression(GeneratedMvelParser.java:2167)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.ConditionalOrExpression(GeneratedMvelParser.java:2133)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.ConditionalExpression(GeneratedMvelParser.java:2113)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.Expression(GeneratedMvelParser.java:1946)
      [ERROR]   org.drools.mvel.parser.GeneratedMvelParser.DrlxExpression(GeneratedMvelParser.java:5839)
      [ERROR]   org.drools.mvel.parser.DrlxParser.lambda$null$0(DrlxParser.java:46)
      [ERROR]   org.drools.mvel.parser.MvelParser.parse(MvelParser.java:148)
      [ERROR]   org.drools.mvel.parser.DrlxParser.simplifiedParse(DrlxParser.java:60)
      [ERROR]   org.drools.mvel.parser.DrlxParser.parseExpression(DrlxParser.java:56)
      [ERROR]   org.drools.modelcompiler.builder.generator.DrlxParseUtil.parseExpression(DrlxParseUtil.java:594)
      [ERROR]   org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:99)
      [ERROR]   org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint(PatternDSL.java:136)
      [ERROR]   org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern(PatternDSL.java:235)
      [ERROR]   org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:145)
      [ERROR]   org.drools.compiler.lang.descr.PatternDescr.accept(PatternDescr.java:288)
      [ERROR]   org.drools.modelcompiler.builder.generator.visitor.AndVisitor.visit(AndVisitor.java:50)
      [ERROR]   org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:86)
      [ERROR]   org.drools.modelcompiler.builder.generator.ModelGenerator.processRule(ModelGenerator.java:186)
      [ERROR]   org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel(ModelGenerator.java:159)
      [ERROR]   org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages(ModelBuilderImpl.java:281)
      [ERROR]   org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules(ModelBuilderImpl.java:209)
      [ERROR]   org.drools.modelcompiler.builder.ModelBuilderImpl.postBuild(ModelBuilderImpl.java:129)
      [ERROR]   org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:111)
      [ERROR]   org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:97)
      [ERROR]   org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:268)
      [ERROR]   org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:216)
      [ERROR]   org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:80)
      [ERROR]   org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:279)
      [ERROR]   org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:247)
      [ERROR]   org.kie.maven.plugin.GenerateModelMojo.generateModel(GenerateModelMojo.java:146)
      [ERROR]   org.kie.maven.plugin.GenerateModelMojo.execute(GenerateModelMojo.java:106)
      [ERROR]   org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
      [ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
      [ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
      [ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
      [ERROR]   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
      [ERROR]   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
      [ERROR]   org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
      [ERROR]   org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      [ERROR]   org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
      [ERROR]   org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
      [ERROR]   org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
      [ERROR]   org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
      [ERROR]   org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
      [ERROR]   org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
      [ERROR]   java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR]   java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR]   java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR]   java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
      [ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
      [ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
      [ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
      ...
      
      Show
      $ unzip reproducer_model_compiler_12a.zip $ cd reproducer_model_compiler_12a $ mvn clean compile exec:exec -DgenerateModel=YES ... [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_model_compiler_12a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed: Encountered unexpected token: "[" "[" [ERROR] at line 1, column 10. [ERROR] [ERROR] Was expecting one of: [ERROR] [ERROR] "+" [ERROR] "++" [ERROR] "-" [ERROR] "--" [ERROR] [ERROR] Problem stacktrace : [ERROR] org.drools.mvel.parser.GeneratedMvelParser.generateParseException(GeneratedMvelParser.java:12225) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.jj_consume_token(GeneratedMvelParser.java:12070) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.UnaryExpression(GeneratedMvelParser.java:2541) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.MultiplicativeExpression(GeneratedMvelParser.java:2446) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.AdditiveExpression(GeneratedMvelParser.java:2408) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.ShiftExpression(GeneratedMvelParser.java:2372) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.RelationalExpression(GeneratedMvelParser.java:2322) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.InstanceOfExpression(GeneratedMvelParser.java:2303) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.EqualityExpression(GeneratedMvelParser.java:2265) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.AndExpression(GeneratedMvelParser.java:2243) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.ExclusiveOrExpression(GeneratedMvelParser.java:2222) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.InclusiveOrExpression(GeneratedMvelParser.java:2201) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.ConditionalAndExpression(GeneratedMvelParser.java:2167) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.ConditionalOrExpression(GeneratedMvelParser.java:2133) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.ConditionalExpression(GeneratedMvelParser.java:2113) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.Expression(GeneratedMvelParser.java:1946) [ERROR] org.drools.mvel.parser.GeneratedMvelParser.DrlxExpression(GeneratedMvelParser.java:5839) [ERROR] org.drools.mvel.parser.DrlxParser.lambda$null$0(DrlxParser.java:46) [ERROR] org.drools.mvel.parser.MvelParser.parse(MvelParser.java:148) [ERROR] org.drools.mvel.parser.DrlxParser.simplifiedParse(DrlxParser.java:60) [ERROR] org.drools.mvel.parser.DrlxParser.parseExpression(DrlxParser.java:56) [ERROR] org.drools.modelcompiler.builder.generator.DrlxParseUtil.parseExpression(DrlxParseUtil.java:594) [ERROR] org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse(ConstraintParser.java:99) [ERROR] org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint(PatternDSL.java:136) [ERROR] org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern(PatternDSL.java:235) [ERROR] org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:145) [ERROR] org.drools.compiler.lang.descr.PatternDescr.accept(PatternDescr.java:288) [ERROR] org.drools.modelcompiler.builder.generator.visitor.AndVisitor.visit(AndVisitor.java:50) [ERROR] org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit(ModelGeneratorVisitor.java:86) [ERROR] org.drools.modelcompiler.builder.generator.ModelGenerator.processRule(ModelGenerator.java:186) [ERROR] org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel(ModelGenerator.java:159) [ERROR] org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages(ModelBuilderImpl.java:281) [ERROR] org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules(ModelBuilderImpl.java:209) [ERROR] org.drools.modelcompiler.builder.ModelBuilderImpl.postBuild(ModelBuilderImpl.java:129) [ERROR] org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:111) [ERROR] org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:97) [ERROR] org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:268) [ERROR] org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:216) [ERROR] org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:80) [ERROR] org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:279) [ERROR] org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:247) [ERROR] org.kie.maven.plugin.GenerateModelMojo.generateModel(GenerateModelMojo.java:146) [ERROR] org.kie.maven.plugin.GenerateModelMojo.execute(GenerateModelMojo.java:106) [ERROR] org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) [ERROR] org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) [ERROR] org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) [ERROR] org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) [ERROR] org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [ERROR] org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [ERROR] org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) [ERROR] org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) [ERROR] org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) [ERROR] org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) [ERROR] org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) [ERROR] org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) [ERROR] org.apache.maven.cli.MavenCli.main(MavenCli.java:193) [ERROR] java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [ERROR] java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] java.base/java.lang.reflect.Method.invoke(Method.java:566) [ERROR] org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) [ERROR] org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) [ERROR] org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) [ERROR] org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) ...
    • 1
    • Release Notes
    • 2020 Week 52-03 (from Dec 21), 2021 Week 04-06 (from Jan 25), 2021 Week 07-09 (from Feb 15)
    • +

    Description

      Binding a list written in MVEL expression like (*1-1) causes a build error like (*2) in executable model.
      This issue does not occur in build with executable model disabled.

      (*1)

      package com.example.reproducer
      
      import com.example.reproducer.Car
      
      dialect "mvel"
      
      rule "rule12a"
          when
              $car : Car( $group : ["compact", "medium", "luxury"] )    // ..... (*1-1)
          then
              System.out.println("***** Which group " + $group + " is " + $car + " categorized into?");
      end
      

      (*2)

      [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_model_compiler_12a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed: Encountered unexpected token: "[" "["
      [ERROR]     at line 1, column 10.
      [ERROR] 
      [ERROR] Was expecting one of:
      [ERROR] 
      [ERROR]     "+"
      [ERROR]     "++"
      [ERROR]     "-"
      [ERROR]     "--"
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-myoshida Masato Yoshida
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: