Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6366

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • executable model

      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
              lmolteni@redhat.com Luca Molteni
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: