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

Binary operation for BigDecimal values cannot be compiled in executable model in mvel dialect mode.

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.5.0.GA, 7.5.1.GA, 7.6.0.GA, 7.7.0.GA, 7.7.1.GA
    • Fix Version/s: 7.9.0.GA
    • Component/s: BRE
    • Labels:
      None
    • Environment:

      The user's environment is RHDM 7.7.1, but the issue occurs on RHDM 7.5.0 and later.

    • Target Release:
    • Fix Build:
      CR1
    • Steps to Reproduce:
      Hide

      Steps to Reproduce

      $ unzip reproducer_02713159.zip
      $ cd reproducer_02713159
      $ mvn clean compile exec:exec
      

      Note: This issue does not occur when compiling with -DgenerateModel=NO, and the rule is successfully executed.

      Show
      Steps to Reproduce $ unzip reproducer_02713159.zip $ cd reproducer_02713159 $ mvn clean compile exec:exec Note: This issue does not occur when compiling with -DgenerateModel=NO, and the rule is successfully executed.
    • Affects:
      Release Notes
    • Sprint:
      2020 Week 31-33 (from Jul 27)
    • QE Test Coverage:
      +

      Description

      In a rule in "mvel" dialect mode, binary operation including BigDecimal type values like $p.salary = $p.salary + 50000 ($p.salary is BigDecimal type property) causes compilation error in executable model. The error message is as follows:

      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] /work2/cases/02713159/reproducer_02713159/target/generated-sources/drools-model-compiler/main/java/org/example/reproducer/Rules2a5935db629e45d8b951392188ce055cRuleMethods0.java:[36,76] salary has private access in org.example.reproducer.Person                ..... (*1)
      [ERROR] /work2/cases/02713159/reproducer_02713159/target/generated-sources/drools-model-compiler/main/java/org/example/reproducer/Rules2a5935db629e45d8b951392188ce055cRuleMethods0.java:[36,101] bad operand types for binary operator '+'                                ..... (*2)
        first type:  java.math.BigDecimal
        second type: int
      [INFO] 2 errors
      

      Additional Notes:

      • When $p.salary is int type property, compilation succeeds.
      • When $p.salary is Integer type property, the error (*2) does not occur but the error (*1) occurs.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                myoshida Masato Yoshida
                Tester:
                Daniel Rosa
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: