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

Wrong property reactivity with non getter chain of non-direct statements

    Details

    • Sprint:
      2020 Week 16-18 (from Apr 13)
    • Story Points:
      3
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      DROOLS-5025 solved a case like this by excluding getter property from property reactivity mask.

      rule R1 when
          $p : Person( name == "Mario" )
      then
          System.out.println("name = " + $p.getName());
          modify($p) { setAge(41) };
      end
      

      However, there are still some cases which cause unexpected property reactivity.

      For example, the rule below causes an infinite loop with executable model because "name" is considered as modified property.

      rule R1 when
          $p : Person( name == "Mario" )
      then
          System.out.println("name.length = " + $p.getName().length());
          modify($p) { setAge(41) };
      end
      

      update() without modify block has the same issue.

      In standard-drl (DialectUtil.parseModifiedProperties), "getter + otherMethod" chain is considered that the property is modified. So excutable model follows the same.

      However, executable model evaluates all method calls in RHS while standard-drl evaluates only direct statements like "setName("AAA");" or "getName().xxx();". executable model also should follow.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tkobayashi Toshiya Kobayashi
                  Reporter:
                  tkobayashi Toshiya Kobayashi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: