[jboss-jira] [JBoss JIRA] (DROOLS-678) Constraints index Null values as 0s

Mario Fusco (JIRA) issues at jboss.org
Mon Jan 12 10:37:49 EST 2015


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

Mario Fusco resolved DROOLS-678.
--------------------------------
    Fix Version/s: 6.2.0.Final
       Resolution: Done


Fixed by https://github.com/droolsjbpm/drools/commit/1d7be3fc5dd86a6051ae09fd494b1f62961bc1b5

> Constraints index Null values as 0s
> -----------------------------------
>
>                 Key: DROOLS-678
>                 URL: https://issues.jboss.org/browse/DROOLS-678
>             Project: Drools
>          Issue Type: Bug
>            Reporter: Mario Fusco
>            Assignee: Mario Fusco
>             Fix For: 6.2.0.Final
>
>
> In the following test case:
> {code}
>         @Test
>         public void testAlphaIndexing() throws Exception {
>             String drl =
>                     "    package org.drools.test; " +
>      
>                     "    declare ObjectB " +
>                     "       name : String " +
>                     "       intValue : Integer " +
>                     "    end " +
>      
>                     "    rule 'insert object' " +
>                     "       when " +
>                     "       then " +
>                     "           insert( new ObjectB( null, 0 ) ); " +
>                     "    end " +
>      
>                     "    rule 'rule 1' " +
>                     "       when " +
>                     "           ObjectB( intValue == 1 ) " +
>                     "       then " +
>                     "    end " +
>      
>                     "    rule 'rule 2' " +
>                     "       when " +
>                     "           ObjectB( intValue == 2 ) " +
>                     "       then " +
>                     "    end " +
>      
>                     "    rule 'rule 3' " +
>                     "       when " +
>                     "           $b : ObjectB( intValue == null ) " +
>                     "       then\n" +
>                     "           System.out.println( $b ); " +
>                     "    end" +
>                     "\n" ;
>      
>             KieHelper helper = new KieHelper();
>             helper.addContent( drl, ResourceType.DRL );
>             assertTrue( helper.verify().getMessages( org.kie.api.builder.Message.Level.ERROR ).isEmpty() );
>             helper.build(  ).newKieSession().fireAllRules();
>         }
> {code}
> rule 3 fires even if it shouldn't



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list