[jboss-jira] [JBoss JIRA] (JBRULES-3111) Regression: constraint comparing nested accessor to true fires when false

Edson Tirelli (Closed) (JIRA) jira-events at lists.jboss.org
Wed Oct 5 13:46:19 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Edson Tirelli closed JBRULES-3111.
----------------------------------


    
> Regression: constraint comparing nested accessor to true fires when false  
> ---------------------------------------------------------------------------
>
>                 Key: JBRULES-3111
>                 URL: https://issues.jboss.org/browse/JBRULES-3111
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-compiler (expert)
>    Affects Versions: 5.2.0.Final
>            Reporter: Wolfgang Laun
>            Assignee: Edson Tirelli
>            Priority: Blocker
>             Fix For: 5.3.0.Final
>
>
> The .drl file below produces 
>    r3:one false
>    r2:one false
>    r1:one true
> but only r1 is expected to fire.
> Removing all "== true" is one way of showing the correct result.
> declare Bool123
>    bool1 : boolean
>    bool2 : boolean
>    bool3 : boolean
> end
> declare Thing
>    name    : String
>    bool123 : Bool123
> end
> rule kickOff
> when
> then
>     insert( new Thing( "one",   new Bool123( true,  false, false ) ) );
>     insert( new Thing( "two",   new Bool123( false, false, false ) ) );
>     insert( new Thing( "three", new Bool123( false, false, false ) ) );
> end
> rule r1
> when
>     $t: Thing( bool123.bool1 == true )
> then
>     System.out.println( "r1:" + $t.getName() + " " + $t.getBool123().isBool1() );
> end
> rule r2
> when
>     $t: Thing( bool123.bool2 == true )
> then
>     System.out.println( "r2:" + $t.getName() + " " + $t.getBool123().isBool2() );
> end
> rule r3
> when
>     $t: Thing( bool123.bool3 == true )
> then
>     System.out.println( "r3:" + $t.getName() + " " + $t.getBool123().isBool3() );
> end
> ~

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list