Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3193

Modify block does not work with variables declared in the consequence

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.2.0.Final, 5.3.0.Beta1
    • Fix Version/s: 5.3.0.CR1
    • Component/s: drools-compiler
    • Labels:
      None

      Description

      Reported by Wolfgang:

      ========

      This rule

      test.drl
      rule "test"
      when
          $l : ArrayList() from collect (MyClass (attribute == false));
      then
          for(Object o : new ArrayList( $l )) {
              MyClass o2 = (MyClass) o;
              modify(o2) { setAttribute(true) } 
          }
      end
      

      does not compile: The method setAttribute(boolean) is undefined for the type Object

      This, however, works:

         modify( (MyClass)o) { setAttribute(true) } 
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                tirelli Edson Tirelli
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: