Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-678

Constraints index Null values as 0s

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.2.0.Final
    • None
    • None
    • None

    Description

      In the following test case:

              @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();
              }
      

      rule 3 fires even if it shouldn't

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: