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

@watch annotation containing "!*" does not work as expected in executable model.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.9.0.GA
    • 7.10.1.GA
    • BRE
    • This issue occurs on RHDM 7.9.0.

    • CR1
    • Hide
      1. Extract reproducer.
        $ unzip reproducer_model_compiler_9b.zip
        $ cd reproducer_model_compiler_9b
        
      2. Build and execute the rule.
        $ ./run_mvn    # mvn clean compile exec:exec -DgenerateModel=YES
            :
            :
        ***** start
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 10000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 30000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 50000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 70000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 90000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 110000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 130000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 150000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 170000, $point2 = 20000
        ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $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_9b.zip $ cd reproducer_model_compiler_9b Build and execute the rule. $ ./run_mvn # mvn clean compile exec:exec -DgenerateModel=YES : : ***** start ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 10000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 30000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 50000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 70000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 90000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 110000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 130000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 150000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 170000, $point2 = 20000 ***** Action of "rule9b3" -- $fact = com.example.reproducer.Fact@14f5da2c, $point1 = 190000, $point2 = 20000 ***** end : : Expected behavior: the rule is executed only once. Actual behavior: the rule is executed repeatedly.
    • Release Notes
    • 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 @watch(!*) annotation is specified to the pattern like (*1-1). @watch annotation containing !* as below does not work as expected, as well as @watch(!*).

      • @watch(!*, point2)
      • @watch(!*, point1)
      • @watch(point1, !*)

      On the other hand, @watch not containing !*, for example, @watch(!point1, point2) or @watch(!point1, point3), works as expected.

      (*1)

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: