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

Assignment to BigDecimal type property causes compilation errors in executable model.

    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
      $ unzip reproducer_02801729_3a.zip 
      $ cd reproducer_02801729_3a
      $ mvn clean compile exec:exec -DgenerateModel=YES
          :
          :
      [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile-1) @ reproducer_02801729_3a ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 6 source files to /test/reproducer_02801729_3a/target/classes
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,13] weight has private access in com.example.reproducer.Bus
      [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,23] incompatible types: int cannot be converted to java.math.BigDecimal
      [INFO] 2 errors 
      [INFO] -------------------------------------------------------------
          :
          :
      
      Show
      $ unzip reproducer_02801729_3a.zip $ cd reproducer_02801729_3a $ mvn clean compile exec:exec -DgenerateModel=YES : : [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile-1) @ reproducer_02801729_3a --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 6 source files to /test/reproducer_02801729_3a/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,13] weight has private access in com.example.reproducer.Bus [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,23] incompatible types: int cannot be converted to java.math.BigDecimal [INFO] 2 errors [INFO] ------------------------------------------------------------- : :
    • Release Notes
    • 2020 Week 49-51 (from Nov 30)
    • +

    Description

      Compiling a rule like (*1) which is described in MVEL dialect and contains an assignment statement to BigDecimal type property with executable rule models enabled, compilation errors like (*2) occur.

      (*1)

      package com.example.reproducer
      
      import com.example.reproducer.Bus
      
      dialect "mvel"
      
      rule "bus3a"
          when
              $bus : Bus()
          then
              modify($bus) {
                  weight = 13000
              }
              System.out.println("***** " + $bus + ", weight = " + $bus.weight);
      end
      

      $bus.weight is a BigDecimal type property.

      (*2)

      [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,13] weight has private access in com.example.reproducer.Bus
      [ERROR] /test/reproducer_02801729_3a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P23/LambdaConsequence23B3ED62B695E9AEA44284D670FC4A7C.java:[20,23] incompatible types: int cannot be converted to java.math.BigDecimal
      

       

      Attachments

        Issue Links

          Activity

            People

              lmolteni@redhat.com Luca Molteni
              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: