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

Not pattern dereferencing a variable in a constraint is wrongly evaluated using the executable model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • None
    • None
    • None
    • 2020 Week 31-33 (from Jul 27)
    • NEW
    • NEW

    Description

      Reproducer

      @Test
      public void testNotWithDereferencingConstraint() {
          final String drl1 =
                  "package org.drools.compiler\n" +
                  "import " + Person.class.getCanonicalName() + ";\n" +
                  "rule R when\n" +
                  "  $p: Person( $name : name )\n" +
                  "  not Person( name.length == $name.length )\n" +
                  "then\n" +
                  "end\n";
      
          KieSession ksession = getKieSession( drl1 );
      
          ksession.insert( new Person("test", 18) );
          assertEquals( 0, ksession.fireAllRules() );
      } 

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: