[jboss-jira] [JBoss JIRA] (DROOLS-678) Coercion from 0 to null causes an unwanted firing

Mario Fusco (JIRA) issues at jboss.org
Mon Jan 5 11:27:31 EST 2015


Mario Fusco created DROOLS-678:
----------------------------------

             Summary: Coercion from 0 to null causes an unwanted firing
                 Key: DROOLS-678
                 URL: https://issues.jboss.org/browse/DROOLS-678
             Project: Drools
          Issue Type: Bug
            Reporter: Mario Fusco
            Assignee: Mario Fusco


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