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

Expression like BigDecimal_type_property = BigDecimal_type_property.divide(BigDecimal_value) causes a build failure in executable model.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.10.0.GA
    • 7.9.0.GA
    • BRE
    • RHDM 7.9.0.

    • False
    • False
    • Release Notes
    • CR1
    • +
    • Undefined
    • Hide
      $ unzip reproducer_02801729_3d.zip 
      $ cd reproducer_02801729_3d
      $ mvn clean compile exec:exec -DgenerateModel=YES
          :
          :
      [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) @ reproducer_02801729_3d ---
          :
          :
      [ERROR] Unable to build KieBaseModel:rules
      CompilationProblemErrorResult: org.drools.mvelcompiler.MvelCompilerException: RHS doesn't have a type
      
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  2.969 s
      [INFO] Finished at: 2020-12-04T12:24:52+09:00
      [INFO] ------------------------------------------------------------------------
          :
          :
      
      Show
      $ unzip reproducer_02801729_3d.zip $ cd reproducer_02801729_3d $ mvn clean compile exec:exec -DgenerateModel=YES : : [INFO] --- kie-maven-plugin:7.44.0.Final-redhat-00003:generateModel (default-generateModel) @ reproducer_02801729_3d --- : : [ERROR] Unable to build KieBaseModel:rules CompilationProblemErrorResult: org.drools.mvelcompiler.MvelCompilerException: RHS doesn't have a type [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.969 s [INFO] Finished at: 2020-12-04T12:24:52+09:00 [INFO] ------------------------------------------------------------------------ : :
    • 2020 Week 49-51 (from Nov 30)

    Description

      Compiling a rule like (*1) which is described in MVEL dialect and uses an expression like BigDecimal_type_property = BigDecimal_type_property.divide(BigDecimal_value), for example (*1-1), with executable rule models enabled, an error like (*2) occurs.

      This issue occurs in the case of using the other basic operation add, subtract and multiply as well as divide.

      (*1)

      package com.example.reproducer
      
      import com.example.reproducer.Bus
      import java.math.BigDecimal
      
      dialect "mvel"
      
      rule "bus3d"
          when
              $bus : Bus()
          then
              $bus.weight = $bus.weight.divide(BigDecimal.valueOf(1000));    ..... (*1-1)
              System.out.println("***** " + $bus + ", weight = " + $bus.weight);
      end
      

      $bus.weight is a BigDecimal type property.

      (*2)

      [ERROR] Unable to build KieBaseModel:rules
      CompilationProblemErrorResult: org.drools.mvelcompiler.MvelCompilerException: RHS doesn't have a type
      

      Attachments

        Issue Links

          Activity

            People

              lmolteni@redhat.com Luca Molteni
              rhn-support-myoshida Masato Yoshida
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: