Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3111

Regression: constraint comparing nested accessor to true fires when false

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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
      ~

            etirelli@redhat.com Edson Tirelli
            laune Wolfgang Laun (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Resolved:
              Archived: