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

Type coercion does not work for bound variables in executable model.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.10.1.GA
    • 7.4.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 releases from RHDM 7.4.1 to 7.9.0.

    • False
    • False
    • Release Notes
    • CR1
    • +
    • Undefined
    • Hide
      1. Extract reproducer.
        $ unzip reproducer_model_compiler_15a.zip
        $ cd reproducer_model_compiler_15a
        
      2. Build and execute the rule.
        $ ./run_mvn    # mvn clean compile exec:exec -DgenerateModel=YES
            :
            :
        ***** start
        ***** Action of rule15a1 -- $items = 3
        ***** end
            :
            :
        

      Expected behavior: the action part of the rule is not executed.

      Actual behavior: the action part of the rule is executed.

      Show
      Extract reproducer. $ unzip reproducer_model_compiler_15a.zip $ cd reproducer_model_compiler_15a Build and execute the rule. $ ./run_mvn # mvn clean compile exec:exec -DgenerateModel=YES : : ***** start ***** Action of rule15a1 -- $items = 3 ***** end : : Expected behavior: the action part of the rule is not executed. Actual behavior: the action part of the rule is executed.
    • 2021 Week 07-09 (from Feb 15)

      When executing a rule like (*1) that uses comparison between different-type bound variables (for example, an Integer variable and a String variable consisting of digit characters like (*1-1)), the action part of the rule is unexpectedly fired in executable model though the result of the comparison is expected to be false.

      (*1)

      package com.example.reproducer
      
      import static com.example.reproducer.CommonUtils.getListSize
      
      dialect "java"
      
      rule "rule15a1"
          when
              Order( $target : "3",
                     $items : getListSize(items),
                     $items != $target )           // ..... (*1-1)
          then
              System.out.println("***** Action of rule15a1 -- $items = " + $items);
      end
      

              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:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: