[jboss-jira] [JBoss JIRA] Created: (JBRULES-3193) Modify block does not work with variables declared in the consequence

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Wed Aug 31 18:37:26 EDT 2011


Modify block does not work with variables declared in the consequence
---------------------------------------------------------------------

                 Key: JBRULES-3193
                 URL: https://issues.jboss.org/browse/JBRULES-3193
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-compiler
    Affects Versions: 5.3.0.Beta1, 5.2.0.Final
            Reporter: Edson Tirelli
            Assignee: Edson Tirelli
             Fix For: 5.3.0.CR1


Reported by Wolfgang:

========

This rule

{code:title=test.drl|borderStyle=solid}
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
{code}

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

This, however, works:
{code}
   modify( (MyClass)o) { setAttribute(true) } 
{code}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list