Search in sources :

Example 1 with CollectListAccumulateFunction

use of org.drools.core.base.accumulators.CollectListAccumulateFunction in project drools by kiegroup.

the class GroupByTest method testDecomposedGroupByKeyAnd2Accumulates.

@Test
public void testDecomposedGroupByKeyAnd2Accumulates() throws Exception {
    // DROOLS-6031
    final Global<List> var_results = D.globalOf(List.class, "defaultpkg", "results");
    final Variable<Pair<String, String>> var_$key = (Variable) D.declarationOf(Pair.class);
    final Variable<Pair> var_$accumulate = D.declarationOf(Pair.class);
    final Variable<Person> var_$p = D.declarationOf(Person.class);
    final Variable<Person> var_$p2 = D.declarationOf(Person.class);
    final Variable<String> var_$subkeyA = D.declarationOf(String.class);
    final Variable<String> var_$subkeyB = D.declarationOf(String.class);
    final Variable<List> var_$accresult = D.declarationOf(List.class);
    final Variable<List> var_$accresult2 = D.declarationOf(List.class);
    final Rule rule1 = PatternDSL.rule("R1").build(D.groupBy(// Patterns
    D.and(D.pattern(var_$p), D.pattern(var_$p2).bind(var_$accumulate, var_$p, Pair::create)), // Grouping Function
    var_$p, var_$key, person -> Pair.create(person.getName().substring(0, 1), person.getName().substring(1, 2)), D.accFunction(CollectListAccumulateFunction::new, var_$accumulate).as(var_$accresult), D.accFunction(CollectListAccumulateFunction::new, var_$accumulate).as(var_$accresult2)), // Bindings
    D.pattern(var_$key).bind(var_$subkeyA, Pair::getKey).bind(var_$subkeyB, Pair::getValue), D.pattern(var_$accresult), // Consequence
    D.on(var_$subkeyA, var_$subkeyB, var_$accresult, var_results).execute(($a, $b, $accresult, results) -> {
        results.add($a);
        results.add($b);
        results.add($accresult);
    }));
    final Model model = new ModelImpl().addRule(rule1).addGlobal(var_results);
    final KieSession ksession = KieBaseBuilder.createKieBaseFromModel(model).newKieSession();
    final List<Object> results = new ArrayList<>();
    ksession.setGlobal("results", results);
    ksession.insert("A");
    ksession.insert("test");
    ksession.insert(new Person("Mark", 42));
    assertThat(ksession.fireAllRules()).isEqualTo(1);
    Assertions.assertThat(results.size()).isEqualTo(3);
    Assertions.assertThat(results.get(0)).isEqualTo("M");
    Assertions.assertThat(results.get(1)).isEqualTo("a");
}
Also used : Arrays(java.util.Arrays) InternalFactHandle(org.drools.core.common.InternalFactHandle) Accumulator(org.drools.core.spi.Accumulator) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Global(org.drools.model.Global) RuleEventListener(org.kie.internal.event.rule.RuleEventListener) DSL(org.drools.model.DSL) Child(org.drools.modelcompiler.domain.Child) Match(org.kie.api.runtime.rule.Match) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Declaration(org.drools.core.rule.Declaration) Assertions(org.assertj.core.api.Assertions) KieSession(org.kie.api.runtime.KieSession) Parent(org.drools.modelcompiler.domain.Parent) Set(java.util.Set) Index(org.drools.model.Index) ConsequenceBuilder(org.drools.model.consequences.ConsequenceBuilder) EvaluationUtil(org.drools.modelcompiler.util.EvaluationUtil) Objects(java.util.Objects) List(java.util.List) Tuple(org.drools.core.spi.Tuple) CountAccumulateFunction(org.drools.core.base.accumulators.CountAccumulateFunction) Person(org.drools.modelcompiler.domain.Person) DSL.from(org.drools.model.DSL.from) ModelImpl(org.drools.model.impl.ModelImpl) HashMap(java.util.HashMap) PatternDSL(org.drools.model.PatternDSL) ArrayList(java.util.ArrayList) Function1(org.drools.model.functions.Function1) CollectListAccumulateFunction(org.drools.core.base.accumulators.CollectListAccumulateFunction) RuleEventManager(org.kie.internal.event.rule.RuleEventManager) KieBase(org.kie.api.KieBase) LinkedHashSet(java.util.LinkedHashSet) Model(org.drools.model.Model) IntegerMaxAccumulateFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction) ReteEvaluator(org.drools.core.common.ReteEvaluator) ViewItem(org.drools.model.view.ViewItem) Pair(org.apache.commons.math3.util.Pair) Variable(org.drools.model.Variable) D(org.drools.modelcompiler.dsl.pattern.D) IntegerSumAccumulateFunction(org.drools.core.base.accumulators.IntegerSumAccumulateFunction) ToIntFunction(java.util.function.ToIntFunction) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GroupKey(org.drools.model.functions.accumulate.GroupKey) FactHandle(org.kie.api.runtime.rule.FactHandle) KieBaseBuilder(org.drools.modelcompiler.builder.KieBaseBuilder) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Rule(org.drools.model.Rule) ExprViewItem(org.drools.model.view.ExprViewItem) RuleTerminalNodeLeftTuple(org.drools.core.reteoo.RuleTerminalNodeLeftTuple) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Variable(org.drools.model.Variable) ArrayList(java.util.ArrayList) Model(org.drools.model.Model) List(java.util.List) ArrayList(java.util.ArrayList) KieSession(org.kie.api.runtime.KieSession) Rule(org.drools.model.Rule) ModelImpl(org.drools.model.impl.ModelImpl) Person(org.drools.modelcompiler.domain.Person) Pair(org.apache.commons.math3.util.Pair) Test(org.junit.Test)

Example 2 with CollectListAccumulateFunction

use of org.drools.core.base.accumulators.CollectListAccumulateFunction in project drools by kiegroup.

the class GroupByTest method testNestedGroupBy1a.

@Test
public void testNestedGroupBy1a() throws Exception {
    // DROOLS-6045
    final Global<List> var_results = D.globalOf(List.class, "defaultpkg", "results");
    final Variable<Object> var_$key = D.declarationOf(Object.class);
    final Variable<Person> var_$p = D.declarationOf(Person.class);
    final Variable<Object> var_$accresult = D.declarationOf(Object.class);
    final Rule rule1 = PatternDSL.rule("R1").build(D.accumulate(D.and(D.groupBy(// Patterns
    D.pattern(var_$p), // Grouping Function
    var_$p, var_$key, Person::getAge), // Bindings
    D.pattern(var_$key).expr(k -> ((Integer) k) > 0)), D.accFunction(CollectListAccumulateFunction::new, var_$key).as(var_$accresult)), // Consequence
    D.on(var_$accresult, var_results).execute(($accresult, results) -> {
        results.add($accresult);
    }));
    final Model model = new ModelImpl().addRule(rule1).addGlobal(var_results);
    final KieSession ksession = KieBaseBuilder.createKieBaseFromModel(model).newKieSession();
    final List<Object> results = new ArrayList<>();
    ksession.setGlobal("results", results);
    ksession.insert(new Person("Mark", 42));
    assertThat(ksession.fireAllRules()).isEqualTo(1);
    System.out.println(results);
    Assertions.assertThat(results).containsOnly(Collections.singletonList(42));
}
Also used : Arrays(java.util.Arrays) InternalFactHandle(org.drools.core.common.InternalFactHandle) Accumulator(org.drools.core.spi.Accumulator) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Global(org.drools.model.Global) RuleEventListener(org.kie.internal.event.rule.RuleEventListener) DSL(org.drools.model.DSL) Child(org.drools.modelcompiler.domain.Child) Match(org.kie.api.runtime.rule.Match) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Declaration(org.drools.core.rule.Declaration) Assertions(org.assertj.core.api.Assertions) KieSession(org.kie.api.runtime.KieSession) Parent(org.drools.modelcompiler.domain.Parent) Set(java.util.Set) Index(org.drools.model.Index) ConsequenceBuilder(org.drools.model.consequences.ConsequenceBuilder) EvaluationUtil(org.drools.modelcompiler.util.EvaluationUtil) Objects(java.util.Objects) List(java.util.List) Tuple(org.drools.core.spi.Tuple) CountAccumulateFunction(org.drools.core.base.accumulators.CountAccumulateFunction) Person(org.drools.modelcompiler.domain.Person) DSL.from(org.drools.model.DSL.from) ModelImpl(org.drools.model.impl.ModelImpl) HashMap(java.util.HashMap) PatternDSL(org.drools.model.PatternDSL) ArrayList(java.util.ArrayList) Function1(org.drools.model.functions.Function1) CollectListAccumulateFunction(org.drools.core.base.accumulators.CollectListAccumulateFunction) RuleEventManager(org.kie.internal.event.rule.RuleEventManager) KieBase(org.kie.api.KieBase) LinkedHashSet(java.util.LinkedHashSet) Model(org.drools.model.Model) IntegerMaxAccumulateFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction) ReteEvaluator(org.drools.core.common.ReteEvaluator) ViewItem(org.drools.model.view.ViewItem) Pair(org.apache.commons.math3.util.Pair) Variable(org.drools.model.Variable) D(org.drools.modelcompiler.dsl.pattern.D) IntegerSumAccumulateFunction(org.drools.core.base.accumulators.IntegerSumAccumulateFunction) ToIntFunction(java.util.function.ToIntFunction) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GroupKey(org.drools.model.functions.accumulate.GroupKey) FactHandle(org.kie.api.runtime.rule.FactHandle) KieBaseBuilder(org.drools.modelcompiler.builder.KieBaseBuilder) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Rule(org.drools.model.Rule) ExprViewItem(org.drools.model.view.ExprViewItem) RuleTerminalNodeLeftTuple(org.drools.core.reteoo.RuleTerminalNodeLeftTuple) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ArrayList(java.util.ArrayList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Model(org.drools.model.Model) List(java.util.List) ArrayList(java.util.ArrayList) KieSession(org.kie.api.runtime.KieSession) Rule(org.drools.model.Rule) ModelImpl(org.drools.model.impl.ModelImpl) Person(org.drools.modelcompiler.domain.Person) Test(org.junit.Test)

Example 3 with CollectListAccumulateFunction

use of org.drools.core.base.accumulators.CollectListAccumulateFunction in project drools by kiegroup.

the class GroupByTest method testNestedGroupBy2.

@Test
public void testNestedGroupBy2() throws Exception {
    // DROOLS-6045
    final Global<List> var_results = D.globalOf(List.class, "defaultpkg", "results");
    final Variable<Object> var_$key = D.declarationOf(Object.class);
    final Variable<Object> var_$keyOuter = D.declarationOf(Object.class);
    final Variable<Person> var_$p = D.declarationOf(Person.class);
    final Variable<Object> var_$accresult = D.declarationOf(Object.class);
    final Rule rule1 = PatternDSL.rule("R1").build(D.groupBy(D.and(D.groupBy(// Patterns
    D.pattern(var_$p), // Grouping Function
    var_$p, var_$key, Person::getAge), // Bindings
    D.pattern(var_$key).expr(k -> ((Integer) k) > 0)), var_$key, var_$keyOuter, k -> ((Integer) k) * 2, D.accFunction(CollectListAccumulateFunction::new, var_$keyOuter).as(var_$accresult)), // Consequence
    D.on(var_$keyOuter, var_$accresult, var_results).execute(($outerKey, $accresult, results) -> {
        results.add($accresult);
    }));
    final Model model = new ModelImpl().addRule(rule1).addGlobal(var_results);
    final KieSession ksession = KieBaseBuilder.createKieBaseFromModel(model).newKieSession();
    final List<Object> results = new ArrayList<>();
    ksession.setGlobal("results", results);
    ksession.insert("A");
    ksession.insert("test");
    ksession.insert(new Person("Mark", 42));
    assertThat(ksession.fireAllRules()).isEqualTo(1);
}
Also used : Arrays(java.util.Arrays) InternalFactHandle(org.drools.core.common.InternalFactHandle) Accumulator(org.drools.core.spi.Accumulator) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Global(org.drools.model.Global) RuleEventListener(org.kie.internal.event.rule.RuleEventListener) DSL(org.drools.model.DSL) Child(org.drools.modelcompiler.domain.Child) Match(org.kie.api.runtime.rule.Match) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Declaration(org.drools.core.rule.Declaration) Assertions(org.assertj.core.api.Assertions) KieSession(org.kie.api.runtime.KieSession) Parent(org.drools.modelcompiler.domain.Parent) Set(java.util.Set) Index(org.drools.model.Index) ConsequenceBuilder(org.drools.model.consequences.ConsequenceBuilder) EvaluationUtil(org.drools.modelcompiler.util.EvaluationUtil) Objects(java.util.Objects) List(java.util.List) Tuple(org.drools.core.spi.Tuple) CountAccumulateFunction(org.drools.core.base.accumulators.CountAccumulateFunction) Person(org.drools.modelcompiler.domain.Person) DSL.from(org.drools.model.DSL.from) ModelImpl(org.drools.model.impl.ModelImpl) HashMap(java.util.HashMap) PatternDSL(org.drools.model.PatternDSL) ArrayList(java.util.ArrayList) Function1(org.drools.model.functions.Function1) CollectListAccumulateFunction(org.drools.core.base.accumulators.CollectListAccumulateFunction) RuleEventManager(org.kie.internal.event.rule.RuleEventManager) KieBase(org.kie.api.KieBase) LinkedHashSet(java.util.LinkedHashSet) Model(org.drools.model.Model) IntegerMaxAccumulateFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction) ReteEvaluator(org.drools.core.common.ReteEvaluator) ViewItem(org.drools.model.view.ViewItem) Pair(org.apache.commons.math3.util.Pair) Variable(org.drools.model.Variable) D(org.drools.modelcompiler.dsl.pattern.D) IntegerSumAccumulateFunction(org.drools.core.base.accumulators.IntegerSumAccumulateFunction) ToIntFunction(java.util.function.ToIntFunction) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GroupKey(org.drools.model.functions.accumulate.GroupKey) FactHandle(org.kie.api.runtime.rule.FactHandle) KieBaseBuilder(org.drools.modelcompiler.builder.KieBaseBuilder) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Rule(org.drools.model.Rule) ExprViewItem(org.drools.model.view.ExprViewItem) RuleTerminalNodeLeftTuple(org.drools.core.reteoo.RuleTerminalNodeLeftTuple) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ArrayList(java.util.ArrayList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Model(org.drools.model.Model) List(java.util.List) ArrayList(java.util.ArrayList) KieSession(org.kie.api.runtime.KieSession) Rule(org.drools.model.Rule) ModelImpl(org.drools.model.impl.ModelImpl) Person(org.drools.modelcompiler.domain.Person) Test(org.junit.Test)

Example 4 with CollectListAccumulateFunction

use of org.drools.core.base.accumulators.CollectListAccumulateFunction in project drools by kiegroup.

the class GroupByTest method testNestedGroupBy1b.

@Test
public void testNestedGroupBy1b() throws Exception {
    // DROOLS-6045
    final Global<List> var_results = D.globalOf(List.class, "defaultpkg", "results");
    final Variable<Object> var_$key = D.declarationOf(Object.class);
    final Variable<Person> var_$p = D.declarationOf(Person.class);
    final Variable<Object> var_$accresult = D.declarationOf(Object.class);
    final Rule rule1 = PatternDSL.rule("R1").build(D.accumulate(D.and(D.groupBy(// Patterns
    D.pattern(var_$p), // Grouping Function
    var_$p, var_$key, Person::getAge), // Bindings
    D.pattern(var_$key)), D.accFunction(CollectListAccumulateFunction::new, var_$key).as(var_$accresult)), // Consequence
    D.on(var_$accresult, var_results).execute(($accresult, results) -> {
        results.add($accresult);
    }));
    final Model model = new ModelImpl().addRule(rule1).addGlobal(var_results);
    final KieSession ksession = KieBaseBuilder.createKieBaseFromModel(model).newKieSession();
    final List<Object> results = new ArrayList<>();
    ksession.setGlobal("results", results);
    ksession.insert(new Person("Mark", 42));
    assertThat(ksession.fireAllRules()).isEqualTo(1);
    Assertions.assertThat(results).containsOnly(Collections.singletonList(42));
}
Also used : Arrays(java.util.Arrays) InternalFactHandle(org.drools.core.common.InternalFactHandle) Accumulator(org.drools.core.spi.Accumulator) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Global(org.drools.model.Global) RuleEventListener(org.kie.internal.event.rule.RuleEventListener) DSL(org.drools.model.DSL) Child(org.drools.modelcompiler.domain.Child) Match(org.kie.api.runtime.rule.Match) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Declaration(org.drools.core.rule.Declaration) Assertions(org.assertj.core.api.Assertions) KieSession(org.kie.api.runtime.KieSession) Parent(org.drools.modelcompiler.domain.Parent) Set(java.util.Set) Index(org.drools.model.Index) ConsequenceBuilder(org.drools.model.consequences.ConsequenceBuilder) EvaluationUtil(org.drools.modelcompiler.util.EvaluationUtil) Objects(java.util.Objects) List(java.util.List) Tuple(org.drools.core.spi.Tuple) CountAccumulateFunction(org.drools.core.base.accumulators.CountAccumulateFunction) Person(org.drools.modelcompiler.domain.Person) DSL.from(org.drools.model.DSL.from) ModelImpl(org.drools.model.impl.ModelImpl) HashMap(java.util.HashMap) PatternDSL(org.drools.model.PatternDSL) ArrayList(java.util.ArrayList) Function1(org.drools.model.functions.Function1) CollectListAccumulateFunction(org.drools.core.base.accumulators.CollectListAccumulateFunction) RuleEventManager(org.kie.internal.event.rule.RuleEventManager) KieBase(org.kie.api.KieBase) LinkedHashSet(java.util.LinkedHashSet) Model(org.drools.model.Model) IntegerMaxAccumulateFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction) ReteEvaluator(org.drools.core.common.ReteEvaluator) ViewItem(org.drools.model.view.ViewItem) Pair(org.apache.commons.math3.util.Pair) Variable(org.drools.model.Variable) D(org.drools.modelcompiler.dsl.pattern.D) IntegerSumAccumulateFunction(org.drools.core.base.accumulators.IntegerSumAccumulateFunction) ToIntFunction(java.util.function.ToIntFunction) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GroupKey(org.drools.model.functions.accumulate.GroupKey) FactHandle(org.kie.api.runtime.rule.FactHandle) KieBaseBuilder(org.drools.modelcompiler.builder.KieBaseBuilder) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Rule(org.drools.model.Rule) ExprViewItem(org.drools.model.view.ExprViewItem) RuleTerminalNodeLeftTuple(org.drools.core.reteoo.RuleTerminalNodeLeftTuple) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ArrayList(java.util.ArrayList) Model(org.drools.model.Model) List(java.util.List) ArrayList(java.util.ArrayList) KieSession(org.kie.api.runtime.KieSession) Rule(org.drools.model.Rule) ModelImpl(org.drools.model.impl.ModelImpl) Person(org.drools.modelcompiler.domain.Person) Test(org.junit.Test)

Example 5 with CollectListAccumulateFunction

use of org.drools.core.base.accumulators.CollectListAccumulateFunction in project drools by kiegroup.

the class GroupByTest method testDecomposedGroupByKeyAnd2AccumulatesInConsequence.

@Test
public void testDecomposedGroupByKeyAnd2AccumulatesInConsequence() throws Exception {
    // DROOLS-6031
    final Global<List> var_results = D.globalOf(List.class, "defaultpkg", "results");
    final Variable<Pair<String, String>> var_$key = (Variable) D.declarationOf(Pair.class);
    final Variable<Pair> var_$accumulate = D.declarationOf(Pair.class);
    final Variable<Person> var_$p = D.declarationOf(Person.class);
    final Variable<Person> var_$p2 = D.declarationOf(Person.class);
    final Variable<String> var_$subkeyA = D.declarationOf(String.class);
    final Variable<String> var_$subkeyB = D.declarationOf(String.class);
    final Variable<List> var_$accresult = D.declarationOf(List.class);
    final Variable<List> var_$accresult2 = D.declarationOf(List.class);
    final Rule rule1 = PatternDSL.rule("R1").build(D.groupBy(// Patterns
    D.and(D.pattern(var_$p), D.pattern(var_$p2).bind(var_$accumulate, var_$p, Pair::create)), // Grouping Function
    var_$p, var_$key, person -> Pair.create(person.getName().substring(0, 1), person.getName().substring(1, 2)), D.accFunction(CollectListAccumulateFunction::new, var_$accumulate).as(var_$accresult), D.accFunction(CollectListAccumulateFunction::new, var_$accumulate).as(var_$accresult2)), // Bindings
    D.pattern(var_$accresult2), // Consequence
    D.on(var_$key, var_$accresult, var_$accresult2, var_results).execute(($key, $accresult, $accresult2, results) -> {
        results.add($key);
    }));
    final Model model = new ModelImpl().addRule(rule1).addGlobal(var_results);
    final KieSession ksession = KieBaseBuilder.createKieBaseFromModel(model).newKieSession();
    final List<Object> results = new ArrayList<>();
    ksession.setGlobal("results", results);
    ksession.insert("A");
    ksession.insert("test");
    ksession.insert(new Person("Mark", 42));
    assertThat(ksession.fireAllRules()).isEqualTo(1);
    Assertions.assertThat(results.size()).isEqualTo(1);
}
Also used : Arrays(java.util.Arrays) InternalFactHandle(org.drools.core.common.InternalFactHandle) Accumulator(org.drools.core.spi.Accumulator) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Global(org.drools.model.Global) RuleEventListener(org.kie.internal.event.rule.RuleEventListener) DSL(org.drools.model.DSL) Child(org.drools.modelcompiler.domain.Child) Match(org.kie.api.runtime.rule.Match) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Declaration(org.drools.core.rule.Declaration) Assertions(org.assertj.core.api.Assertions) KieSession(org.kie.api.runtime.KieSession) Parent(org.drools.modelcompiler.domain.Parent) Set(java.util.Set) Index(org.drools.model.Index) ConsequenceBuilder(org.drools.model.consequences.ConsequenceBuilder) EvaluationUtil(org.drools.modelcompiler.util.EvaluationUtil) Objects(java.util.Objects) List(java.util.List) Tuple(org.drools.core.spi.Tuple) CountAccumulateFunction(org.drools.core.base.accumulators.CountAccumulateFunction) Person(org.drools.modelcompiler.domain.Person) DSL.from(org.drools.model.DSL.from) ModelImpl(org.drools.model.impl.ModelImpl) HashMap(java.util.HashMap) PatternDSL(org.drools.model.PatternDSL) ArrayList(java.util.ArrayList) Function1(org.drools.model.functions.Function1) CollectListAccumulateFunction(org.drools.core.base.accumulators.CollectListAccumulateFunction) RuleEventManager(org.kie.internal.event.rule.RuleEventManager) KieBase(org.kie.api.KieBase) LinkedHashSet(java.util.LinkedHashSet) Model(org.drools.model.Model) IntegerMaxAccumulateFunction(org.drools.core.base.accumulators.IntegerMaxAccumulateFunction) ReteEvaluator(org.drools.core.common.ReteEvaluator) ViewItem(org.drools.model.view.ViewItem) Pair(org.apache.commons.math3.util.Pair) Variable(org.drools.model.Variable) D(org.drools.modelcompiler.dsl.pattern.D) IntegerSumAccumulateFunction(org.drools.core.base.accumulators.IntegerSumAccumulateFunction) ToIntFunction(java.util.function.ToIntFunction) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GroupKey(org.drools.model.functions.accumulate.GroupKey) FactHandle(org.kie.api.runtime.rule.FactHandle) KieBaseBuilder(org.drools.modelcompiler.builder.KieBaseBuilder) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Rule(org.drools.model.Rule) ExprViewItem(org.drools.model.view.ExprViewItem) RuleTerminalNodeLeftTuple(org.drools.core.reteoo.RuleTerminalNodeLeftTuple) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Variable(org.drools.model.Variable) ArrayList(java.util.ArrayList) Model(org.drools.model.Model) List(java.util.List) ArrayList(java.util.ArrayList) KieSession(org.kie.api.runtime.KieSession) Rule(org.drools.model.Rule) ModelImpl(org.drools.model.impl.ModelImpl) Person(org.drools.modelcompiler.domain.Person) Pair(org.apache.commons.math3.util.Pair) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)5 Arrays (java.util.Arrays)5 Collections (java.util.Collections)5 HashMap (java.util.HashMap)5 LinkedHashSet (java.util.LinkedHashSet)5 List (java.util.List)5 Map (java.util.Map)5 Objects (java.util.Objects)5 Set (java.util.Set)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 ToIntFunction (java.util.function.ToIntFunction)5 Pair (org.apache.commons.math3.util.Pair)5 Assertions (org.assertj.core.api.Assertions)5 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)5 CollectListAccumulateFunction (org.drools.core.base.accumulators.CollectListAccumulateFunction)5 CountAccumulateFunction (org.drools.core.base.accumulators.CountAccumulateFunction)5 IntegerMaxAccumulateFunction (org.drools.core.base.accumulators.IntegerMaxAccumulateFunction)5 IntegerSumAccumulateFunction (org.drools.core.base.accumulators.IntegerSumAccumulateFunction)5 InternalFactHandle (org.drools.core.common.InternalFactHandle)5 ReteEvaluator (org.drools.core.common.ReteEvaluator)5