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

for-each for the property of fact causes compilation error in executable models.

    XMLWordPrintable

Details

    • Bug
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.10.1.GA
    • 7.11.1.GA
    • BRE
    • CR1
    • Hide

      run attached reproducer by the following command :
      mvn clean compile exec:exec

      But it works by the following command :
      mvn clean compile exec:exec -DgenerateModel=NO

      Show
      run attached reproducer by the following command : mvn clean compile exec:exec But it works by the following command : mvn clean compile exec:exec -DgenerateModel=NO
    • Hide

      use getter in for-each statement like the following

      for(Object $o: $fact.getObjects()){

      Show
      use getter in for-each statement like the following for(Object $o: $fact.getObjects()){
    • 2021 Week 19-21 (from May 10), 2021 Week 22-24 (from May 31)
    • +

    Description

      Compiling a rule like (*1) which is described in MVEL dialect and contains the enhanced "for" (foreach) statement for the property of the fact in the action part with executable rule models enabled, compilation error like (*2) occurs at the enhanced "for" statement.

      (*1)

      dialect "mvel"
      
      rule "rule_for_each"
          when
              $fact : Fact( )
          then
              for(Object $o: $fact.objects){
                  System.out.println("***** Object: " + $o);
              }
      end
      

      (*2)

      [ERROR] /path/to/reproducer_for_each_mvel/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P38/LambdaConsequence38AC43B3394F7F01FE2963E5C1446FBD.java:[25,31] objects has private access in com.example.reproducer.Fact
      

      Attachments

        Issue Links

          Activity

            People

              lmolteni@redhat.com Luca Molteni
              rhn-support-hmiura Hiroko Miura
              Paolo Bizzarri Paolo Bizzarri
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: