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

using OR with patterns in accumulate statement fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 7.61.0.Final
    • core engine
    • None
    • 2021 Week 49-51 (from Dec 6th)
    • Hide

      Use maven to run the attached project.

      Note that the test succeeds if the "OR" is changed to "AND".

      Show
      Use maven to run the attached project. Note that the test succeeds if the "OR" is changed to "AND".
    • NEW
    • NEW

      This accumulate statement

      accumulate(
          $SNTLocation0:SNTLocation(this memberOf $SNTLine.locations)
          and
          (
              PolicyLocation(this!.id==$SNTLocation0!.address!.id,
                             (this.addressLine1 == "16 Royal Crest Drive"))
              or
              PolicyLocation(this!.id==$SNTLocation0!.address!.id,
                             (this.addressLine2 == "Apartment 11"))
          )
          and
          $collection0:SNTLocation(this==$SNTLocation0)
          ;
          $count1: count($collection0)
          ;
          $count1 > 1
      ) 

      fails with "BUG: Can't build a rete network with an inner OR group element".

      I understand that this particular example could be rewritten to remove the OR by using a single PolicyLocation pattern, but it is just an example. My application generates drools code from user input and so the expression in the accumulate statement could be any logical expression using properties from the domain objects.

            mfusco@redhat.com Mario Fusco
            jglass@guidewire.com Jeff Glass (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: