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

Error in executable model generation when trying to bind an enum value

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.9.0.GA
    • 7.10.0.GA
    • BRE
    • RHDM 7.9.0.

    • CR1
    • Hide

      Build reproducer_02801729_2a with executable model enabled like below.

      $ unzip reproducer_02801729_2a.zip
      $ cd reproducer_02801729_2a
      $ mvn clean compile exec:exec    # or mvn clean compile exec:exec -DgenerateModel=YES
          :
          :
      [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) @ reproducer_02801729_2a ---
          :
          :
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  3.103 s
      [INFO] Finished at: 2020-11-24T00:50:47+09:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_02801729_2a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed.: CannotConvertException -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
      

      If you give -X option to mvn, you can see that ToMethodCall$CannotConvertException is thrown in ToMethodCall.convertNameToMethod(String bindingId, ParsedMethod e).

      Caused by: org.drools.modelcompiler.builder.generator.ToMethodCall$CannotConvertException
          at org.drools.modelcompiler.builder.generator.ToMethodCall.convertNameToMethod (ToMethodCall.java:142)
          at org.drools.modelcompiler.builder.generator.ToMethodCall.toMethodCallWithClassCheck (ToMethodCall.java:73)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseFieldAccessExpr (ConstraintParser.java:263)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult (ConstraintParser.java:154)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse (ConstraintParser.java:102)
          at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint (PatternDSL.java:136)
          at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern (PatternDSL.java:235)
          at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit (ModelGeneratorVisitor.java:145)
          at org.drools.compiler.lang.descr.PatternDescr.accept (PatternDescr.java:288)
          at org.drools.modelcompiler.builder.generator.visitor.AndVisitor.visit (AndVisitor.java:50)
          at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit (ModelGeneratorVisitor.java:86)
          at org.drools.modelcompiler.builder.generator.ModelGenerator.processRule (ModelGenerator.java:186)
          at org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel (ModelGenerator.java:159)
          at org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages (ModelBuilderImpl.java:281)
          at org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules (ModelBuilderImpl.java:209)
          at org.drools.modelcompiler.builder.ModelBuilderImpl.postBuild (ModelBuilderImpl.java:129)
          at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:111)
          at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:97)
          at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:268)
          at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:216)
          at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify (AbstractKieProject.java:80)
          at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject (KieBuilderImpl.java:279)
          at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll (KieBuilderImpl.java:247)
          at org.kie.maven.plugin.GenerateModelMojo.generateModel (GenerateModelMojo.java:146)
          at org.kie.maven.plugin.GenerateModelMojo.execute (GenerateModelMojo.java:106)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
      
      Show
      Build reproducer_02801729_2a with executable model enabled like below. $ unzip reproducer_02801729_2a.zip $ cd reproducer_02801729_2a $ mvn clean compile exec:exec # or mvn clean compile exec:exec -DgenerateModel=YES : : [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) @ reproducer_02801729_2a --- : : [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.103 s [INFO] Finished at: 2020-11-24T00:50:47+09:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) on project reproducer_02801729_2a: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel failed.: CannotConvertException -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException If you give -X option to mvn, you can see that ToMethodCall$CannotConvertException is thrown in ToMethodCall.convertNameToMethod(String bindingId, ParsedMethod e). Caused by: org.drools.modelcompiler.builder.generator.ToMethodCall$CannotConvertException at org.drools.modelcompiler.builder.generator.ToMethodCall.convertNameToMethod (ToMethodCall.java:142) at org.drools.modelcompiler.builder.generator.ToMethodCall.toMethodCallWithClassCheck (ToMethodCall.java:73) at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseFieldAccessExpr (ConstraintParser.java:263) at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult (ConstraintParser.java:154) at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse (ConstraintParser.java:102) at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint (PatternDSL.java:136) at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern (PatternDSL.java:235) at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit (ModelGeneratorVisitor.java:145) at org.drools.compiler.lang.descr.PatternDescr.accept (PatternDescr.java:288) at org.drools.modelcompiler.builder.generator.visitor.AndVisitor.visit (AndVisitor.java:50) at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit (ModelGeneratorVisitor.java:86) at org.drools.modelcompiler.builder.generator.ModelGenerator.processRule (ModelGenerator.java:186) at org.drools.modelcompiler.builder.generator.ModelGenerator.generateModel (ModelGenerator.java:159) at org.drools.modelcompiler.builder.ModelBuilderImpl.compileKnowledgePackages (ModelBuilderImpl.java:281) at org.drools.modelcompiler.builder.ModelBuilderImpl.buildRules (ModelBuilderImpl.java:209) at org.drools.modelcompiler.builder.ModelBuilderImpl.postBuild (ModelBuilderImpl.java:129) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:111) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:97) at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:268) at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:216) at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify (AbstractKieProject.java:80) at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject (KieBuilderImpl.java:279) at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll (KieBuilderImpl.java:247) at org.kie.maven.plugin.GenerateModelMojo.generateModel (GenerateModelMojo.java:146) at org.kie.maven.plugin.GenerateModelMojo.execute (GenerateModelMojo.java:106) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    • Release Notes
    • 2020 Week 49-51 (from Nov 30)
    • +

    Description

      Trying to bind a constant enum value like in

      $bus : Bus( $maker : Bus.Maker.HINO )
      

      causes the following error during executable model generation

      Caused by: org.drools.modelcompiler.builder.generator.ToMethodCall$CannotConvertException
          at org.drools.modelcompiler.builder.generator.ToMethodCall.convertNameToMethod (ToMethodCall.java:142)
          at org.drools.modelcompiler.builder.generator.ToMethodCall.toMethodCallWithClassCheck (ToMethodCall.java:73)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.parseFieldAccessExpr (ConstraintParser.java:263)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.getDrlxParseResult (ConstraintParser.java:154)
          at org.drools.modelcompiler.builder.generator.drlxparse.ConstraintParser.drlxParse (ConstraintParser.java:102)
          at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.findAllConstraint (PatternDSL.java:136)
          at org.drools.modelcompiler.builder.generator.visitor.pattern.PatternDSL.buildPattern (PatternDSL.java:235)
          at org.drools.modelcompiler.builder.generator.visitor.ModelGeneratorVisitor.visit (ModelGeneratorVisitor.java:145)
          at org.drools.compiler.lang.descr.PatternDescr.accept (PatternDescr.java:288)

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              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: