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

executable model fails with negation and BigDecimal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.35.0.Final
    • 7.33.0.Final
    • executable model
    • None
    • 2020 Week 07-09 (from Feb 10), 2020 Week 10-12 (from Mar 2)
    • 4
    • NEW
    • NEW

    Description

      When you have a rule like:

      when
        $p : Person(!(money > 20))
      

      , executable model fails with an error:

      bad operand types for binary operator '>'
        first type:  java.math.BigDecimal
        second type: int
      

      This is because the generated code doesn't use EvaluationUtil.

              org.drools.model.Rule rule = D.rule("R").build(D.pattern(var_$p).expr("CE47D630E9C0B4A2A149ED40CEC3E3B0",
                                                                                    (org.drools.modelcompiler.domain.Person _this) -> !(_this.getMoney() > 20),
                                                                                    D.reactOn("money")),
      

      Attachments

        Activity

          People

            rhn-support-tkobayas Toshiya Kobayashi
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: