Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1552

Property reactivity for properties not modified in modify block unexpectedly works in executable model.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.10.1.GA
    • 7.5.0.GA, 7.5.1.GA, 7.6.0.GA, 7.7.0.GA, 7.7.1.GA, 7.8.0.GA, 7.8.1.GA, 7.9.0.GA
    • BRE
    • This issue occurs on all releases from RHDM 7.5.0 to 7.9.0.

    • False
    • False
    • Release Notes
    • CR1
    • +
    • Undefined
    • Hide
      1. Extract reproducer.
        $ unzip reproducer_model_compiler_9a.zip
        $ cd reproducer_model_compiler_9a
        
      2. Build and execute the rule.
        $ ./run_mvn    # mvn clean compile exec:exec -DgenerateModel=YES
            :
            :
        ***** start
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 10000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 30000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 50000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 70000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 90000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 110000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 130000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 150000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 170000, $point2 = 20000
        ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 190000, $point2 = 20000
        ***** end
            :
            :
        

      Expected behavior: the rule is executed only once.

      Actual behavior: the rule is executed repeatedly.

      Show
      Extract reproducer. $ unzip reproducer_model_compiler_9a.zip $ cd reproducer_model_compiler_9a Build and execute the rule. $ ./run_mvn # mvn clean compile exec:exec -DgenerateModel=YES : : ***** start ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 10000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 30000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 50000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 70000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 90000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 110000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 130000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 150000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 170000, $point2 = 20000 ***** Action of "rule9a" -- $fact = com.example.reproducer.Fact@62dae540, $point1 = 190000, $point2 = 20000 ***** end : : Expected behavior: the rule is executed only once. Actual behavior: the rule is executed repeatedly.
    • 2021 Week 07-09 (from Feb 15)

    Description

      Executing a rule like (*1) in executable rule model, the rule is evaluated repeatedly. In this rule, re-evaluation occurs in executable model though $fact.point1 is not modified in modify($fact) block. This issue also occurs for rules written in Java dialect as well as MVEL dialect.

      (*1)

      package com.example.reproducer
      
      dialect "mvel"
      
      rule "rule9a"
          when
              $fact : Fact( $point1 : point1, $point2 : point2 )
          then
              System.out.println("***** Action of \"rule9a\" -- $fact = " + $fact + ", $point1 = " + $point1 + ", $point2 = " + $point2);
              $point1 = $point1.add($point2);
              $fact.point1 = $point1;
              modify($fact){
                  point3 = $point1
              }
      end
      

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rhn-support-myoshida Masato Yoshida
            Daniel Rosa Daniel Rosa
            Daniel Rosa Daniel Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: