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

Variable binding of a property of Map element causes unexpected result in executable model.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.1.0.GA, 7.9.0.GA
    • 7.10.0.GA
    • BRE
    • This issue is found on RHDM 7.1.0 to RHDM 7.9.0.

    • False
    • False
    • +
    • Undefined
    • Already fixed in 7.10
    • Hide
      • Extract reproducer.
        $ unzip reproducer_mc_1a3.zip
        $ cd reproducer_mc_1a3
        
      • Build and execute the rule.
        $ ./run_mvn    # mvn clean compile exec:exec -DgenerateModel=YES
            :
            :
        ***** Action of rule1a3
        ***** $car: com.example.reproducer.Car@4b6690c0, transmission supplier name = A180
            :
            :
        

      Expected result: $supplierName is "ABC Precision Instruments" (the name property of Supplier object).

      Actual result: $supplierName is "A180" (the name property of Car object).

      Show
      Extract reproducer. $ unzip reproducer_mc_1a3.zip $ cd reproducer_mc_1a3 Build and execute the rule. $ ./run_mvn # mvn clean compile exec:exec -DgenerateModel=YES : : ***** Action of rule1a3 ***** $car: com.example.reproducer.Car@4b6690c0, transmission supplier name = A180 : : Expected result: $supplierName is "ABC Precision Instruments" (the name property of Supplier object). Actual result: $supplierName is "A180" (the name property of Car object).
    • 2020 Week 52-03 (from Dec 21)

    Description

      Building and executing a rule written in MVEL dialect like (*1) that accesses to a Map element and binds a property of the element to a variable (*1-1) in executable rule model, the bound variable is an unexpected value. This issue occurs on all releases from RHDM 7.1.0 to 7.9.0.

      (*1)

      package com.example.reproducer
      
      import com.example.reproducer.Car
      
      dialect "mvel"
      
      
      rule "rule1a3"
          when
              $car : Car( $supplierName : suppliers["transmission"].name )    // ..... (*1-1)
          then
              System.out.println("***** Action of rule1a3");
              System.out.println("***** $car: " + $car + ", transmission supplier name = " + $supplierName);
      end
      // suppliers is a {{Map<String, Supplier>}} type property of Car class
      

      Attachments

        Activity

          People

            lmolteni@redhat.com Luca Molteni
            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: