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

Unexpected re-evaluation (loop) by line break in RHS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 7.71.0.Final
    • core engine
    • None
    • 2022 Week 26-28 (from Jun 27), 2022 Week 29-31 (from Jul 18)
    • Workaround Exists
    • Hide

      A) Avoid a line break in a statement in RHS.
      B) Use executable-model

      Show
      A) Avoid a line break in a statement in RHS. B) Use executable-model
    • NEW
    • NEW
    • ---
    • ---

    Description

      Rule like this causes an infinite loop. See a line break and the following line "$fact.getBigDecimal1().subtract($fact.getBigDecimal2());"

      when
          $fact : MathFact( bigDecimal1 != null, bigDecimal2 != null );
      then
          // Notice the calculation is split over lines and this time starts on the line after assignment.
          BigDecimal result =
              $fact.getBigDecimal1().subtract($fact.getBigDecimal2());
             
          System.out.println("\nMathFact.result: " + result);
       
          modify($fact) {
              setBigDecimalResult(result);
          };
      end
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: