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

executable model doesn't resolve bind variable from another pattern of different type in method call in LHS for property reactivity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 8.40.0.Final
    • 7.67.0.Final, 7.73.0.Final, 8.36.0.Final
    • executable model
    • None
    • 2023 Week 15-17 (from Apr 10), 2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22), 2023 Week 24-26 (from Jun 12)
    • NEW
    • NEW
    • ---
    • ---

      Issue Description:

      DROOLS-7372 fixed for a bind variable in the same pattern, but a bind variable from another pattern causes the same reactivity issue.

      rule "Rule 1"
          when
              $fact1 : Fact1( $id1 : id == 1 )
              Fact2( $id2 : id == 2, convertToIdString($id1) == "id1" )
          then
              System.out.println("***** Action of " + drools.getRule().getName());
      
              modify($fact1) {
                  value = $id2
              }
      end
      
      rule "Rule 2"
          when
              Fact1( $id1 : id == 1, value == 2 )
              $fact2 : Fact2( $id2 : id == 2 )
          then
              System.out.println("***** Action of " + drools.getRule().getName());
      
              modify($fact2) {
                  value = $id1
              }
      end
      

      Currently:
      non-exec-model : property reactive. Not loop
      exec-model : class reactive. Infinite loop

      => This is correct to be class reactive (= infinite loop) in exec-model, because $id2 is Fact1.id, not Fact2.id, so $id2 cannot be resolved to Fact2 property.

      Acceptance Criteria:

      • Fix non-exec-model to be class reactive to meet the exec-model behavior.

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

              Created:
              Updated:
              Resolved: