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

compile error in exec model when comparing BigDecimal with result of accumulate max

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.11.1.GA
    • 7.10.1.GA
    • BRE
    • Red Hat Decision Manager 7.10.1

    • False
    • False
    • CR1
    • +
    • Undefined
    • Hide

      run attached reproducer by 'mvn clean compile'.
      If it run with -DgenerateModel=NO, it works.

      Show
      run attached reproducer by 'mvn clean compile'. If it run with -DgenerateModel=NO, it works.
    • 2021 Week 19-21 (from May 10), 2021 Week 22-24 (from May 31)

      When comparing BigDecimal type property with result of accumulate max of BigDecimal like the following,

              accumulate( Fact($bd: bd); $maxBd:max($bd))
              $fact : Fact( bd  == $maxBd)
      

      compilation in executable model fails with ERROR like the following.

      [ERROR] /path/to/reproducer_bd_accumulate_result_compare/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/Rulesfb93dfe4037d47349427eadc64c3e841RuleMethods0.java:[43,137] no suitable constructor found for BigDecimal(java.lang.Number)
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(char[]) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to char[])
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(java.lang.String) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to java.lang.String)
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(double) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to double)
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(java.math.BigInteger) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to java.math.BigInteger)
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(int) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to int)
      [ERROR]     constructor java.math.BigDecimal.BigDecimal(long) is not applicable
      [ERROR]       (argument mismatch; java.lang.Number cannot be converted to long)
      [ERROR]
      

      This works with non-executable model.

              lmolteni@redhat.com Luca Molteni
              rhn-support-hmiura Hiroko Miura
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: