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

Allow both prefixed and infixed AND in nested accumulates

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • core engine
    • None
    • 2019 Week 02-04
    • NEW
    • NEW

      At the moment drools can compile composite condition in a nested accumulate only using a prefixed 'and' like in

          String($l: length)
          accumulate(
              (and
                  Integer(this == $l) 
                  accumulate(
                      Long() 
                      ;$counter: count(1);$counter <= 4)
               )
              ;$mainCounter: count(1);$mCounter <= 2
          )
      

      while it fails when using the infixed notation like in:

          String($l: length)
          accumulate(
              (
                  Integer(this == $l)  and
                  accumulate(
                      Long() 
                      ;$counter: count(1);$counter <= 4)
               )
              ;$mainCounter: count(1);$mCounter <= 2
          )
      

      It is required that this could work also with the infix AND also because this is notation used by the DRLDumper when regenerating the drl from a PackageDescr

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

              Created:
              Updated:
              Resolved: