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

Support OOPath in accumulate functions

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 7.0.0.Beta7
    • core engine
    • 2017 Week 36-37
    • NEW
    • NEW

      It would be nice to have the ability to use OOPath in accumulate functions. E.g. sum(/fact/property).

      Example of a rule:

      import org.drools.compiler.oopath.*;
      global java.lang.Object globalVar
      rule R when
      accumulate ( Adult() ; $accumulateResult: sum(/children/age) )
      then
      kcontext.getKieRuntime().setGlobal(\"globalVar\", $accumulateResult);
      end

              mfusco@redhat.com Mario Fusco
              tzimanyi@redhat.com Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: