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

executable model doesn't fire when Or with trimmed duplicate constraints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.32.0.Final
    • executable model
    • None
    • 2020 Week 07-09 (from Feb 10)
    • 5
    • NEW
    • NEW

      With a rule like this, (see that white spaces around "==" in the second rule are trimmed)

      rule R1 when
         Person( $name: name == "Mark", $age: age ) or
         Person( $name: name == "Mario", $age : age )
      then
        list.add( $name + " is " + $age);
      end
      rule R2 when
         $p: Person( name=="Mark", $age: age ) or
         $p: Person( name=="Mario", $age : age )
      then
        list.add( $p + " has " + $age + " years");
      end
      

      when you insert a fact,

      ksession.insert( new Person( "Mark", 37 ) );
      

      only one rule fires.

              lmolteni@redhat.com Luca Molteni
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: