-
Enhancement
-
Resolution: Done
-
Major
-
None
-
7.44.0.Final
-
None
-
2020 Week 52-03 (from Dec 21)
-
Undefined
-
NEW
-
NEW
-
---
-
---
In some of the OptaPlanner examples, we have Constraint Streams like this:
.groupBy(ProcessAssignment::getService, count()) .groupBy(Service::getTag, max((service, count) -> count))
This will:
- Take all ProcessAssigment instances.
- Count all such instances which run on the same Service.
- Out of all the pairs of (service, count) find the maximum count where the services share the same Tag.
This is an example of groupBy composition. Currently, we implement it with the old, inefficient groupBy. That implementation looks something like this:
when $tuples: List<Tuple<Service, Integer>> from accumulate( $p: ProcessAssignment(), ... groupBy(ProcessAssignment::getService, count()) ) $tuples2: List<Tuple<String, Integer>> from accumulate( $tuple: Tuple<Service, Integer> from $tuples, ... groupBy(Service::getTag, max($tuple._2)) ) $result: Tuple<String, Integer> from $tuples2 then System.out.println($result); end
We'd like the new groupBy construct to be capable of composition instead.
- relates to
-
DROOLS-5581 Add groupBy feature to executable model DSL
- Resolved
-
PLANNER-2239 CS-D: Performance PoC of DROOLS-5697
- Resolved