Martin Weiler created DROOLS-5552:
-------------------------------------
Summary: An accumulate with more than one binding is wrongly generated in the
executable model
Key: DROOLS-5552
URL:
https://issues.redhat.com/browse/DROOLS-5552
Project: Drools
Issue Type: Bug
Reporter: Martin Weiler
Assignee: Mario Fusco
Reproducer
{code:java}
@Test
public void testAccumulateWithManyBindings() {
String str =
"import " + Person.class.getCanonicalName() + ";\n" +
"rule R when\n" +
" accumulate (\n" +
" Person($age : age, $name : name), $max : max( $name.length() )
" +
" )" +
"then\n" +
" insert($max);\n" +
"end";
KieSession ksession = getKieSession( str );
ksession.insert( new Person( "Mario", 40 ) );
ksession.insert( new Person( "Mark", 40 ) );
ksession.insert( new Person( "Luca", 40 ) );
ksession.fireAllRules();
List<Number> results = getObjectsIntoList(ksession, Number.class);
assertEquals(1, results.size());
assertEquals(5, results.get(0).intValue());
}{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)