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.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.5.0.GA, 7.5.1.GA, 7.6.0.GA, 7.7.0.GA, 7.7.1.GA
    • 7.9.0.GA
    • BRE
    • None
    • The user's environment is RHDM 7.7.1, but the issue occurs on RHDM 7.5.0 and later.

    • CR1
    • 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.
    • Release Notes
    • 2020 Week 31-33 (from Jul 27)
    • +

    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.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rhn-support-myoshida Masato Yoshida
            Daniel Rosa Daniel Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: