[
https://issues.jboss.org/browse/DROOLS-1445?page=com.atlassian.jira.plugi...
]
Matteo Mortari edited comment on DROOLS-1445 at 2/20/17 8:12 AM:
-----------------------------------------------------------------
+ additionally, as discussed, similar possibly-connected problem on the test
{{org.drools.compiler.integrationtests.AccumulateTest.testAccFunctionOpaqueJoins}}
When running as original and PropertyReactivity == ALWAYS, the test FAIL and the rete is:
{code:java}
[EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
[ObjectTypeNode(7)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Tick] expiration=-1ms ] on Partition(MAIN)
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li -1
Rd 0 Ri 0
[RuleTerminalNode(9): rule=Update] on Partition(2) d -1 i -1
[LeftInputAdapterNode(10)] on Partition(3) Ld 0 Li 0
[ AccumulateNode(12) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[RuleTerminalNode(13): rule=M] on Partition(3) d -1 i -1
[ AccumulateNode(14) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[RuleTerminalNode(15): rule=J] on Partition(3) d -1 i -1
[ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
[RuleTerminalNode(4): rule=Init] on Partition(1) d -1 i -1
[ObjectTypeNode(5)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=java.lang.Integer] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(6)] on Partition(2) Ld 0 Li 0
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li
-1 Rd 0 Ri 0
[ObjectTypeNode(11)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Data] expiration=-1ms ] on Partition(MAIN)
[ AccumulateNode(12) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[ AccumulateNode(14) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
{code}
While adding a constraints as {{ Tick( tick != null, $index : tick ) }} inside rule M and
J would result in the following rete:
{code:java}
[EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
[ObjectTypeNode(7)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Tick] expiration=-1ms ] on Partition(MAIN)
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li -1
Rd 0 Ri 0
[RuleTerminalNode(9): rule=Update] on Partition(2) d -1 i -1
[AlphaNode(10) constraint=tick != null] on Partition(3) d 2 i 2
[LeftInputAdapterNode(11)] on Partition(3) Ld 0 Li 0
[ AccumulateNode(13) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[RuleTerminalNode(14): rule=M] on Partition(3) d -1 i -1
[ AccumulateNode(15) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[RuleTerminalNode(16): rule=J] on Partition(3) d -1 i -1
[ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
[RuleTerminalNode(4): rule=Init] on Partition(1) d -1 i -1
[ObjectTypeNode(5)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=java.lang.Integer] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(6)] on Partition(2) Ld 0 Li 0
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li
-1 Rd 0 Ri 0
[ObjectTypeNode(12)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Data] expiration=-1ms ] on Partition(MAIN)
[ AccumulateNode(13) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[ AccumulateNode(15) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
{code}
beside the additional alpha node, kindly notice the AccumulateNode are having the Left
Inferred mask correctly populated.
was (Author: tari_manga):
+ additionally, as discussed, similar possibly-connected problem on the test
{{org.drools.compiler.integrationtests.AccumulateTest.testAccFunctionOpaqueJoins}}
When running as original and PropertyReactivity == ALWAYS, the test FAIL and the rete is:
{code:java}
[EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
[ObjectTypeNode(7)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Tick] expiration=-1ms ] on Partition(MAIN)
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li -1
Rd 0 Ri 0
[RuleTerminalNode(9): rule=Update] on Partition(2) d -1 i -1
[LeftInputAdapterNode(10)] on Partition(3) Ld 0 Li 0
[ AccumulateNode(12) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[RuleTerminalNode(13): rule=M] on Partition(3) d -1 i -1
[ AccumulateNode(14) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[RuleTerminalNode(15): rule=J] on Partition(3) d -1 i -1
[ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
[RuleTerminalNode(4): rule=Init] on Partition(1) d -1 i -1
[ObjectTypeNode(5)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=java.lang.Integer] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(6)] on Partition(2) Ld 0 Li 0
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li
-1 Rd 0 Ri 0
[ObjectTypeNode(11)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Data] expiration=-1ms ] on Partition(MAIN)
[ AccumulateNode(12) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
[ AccumulateNode(14) ] on Partition(3) Ld 0 Li 0 Rd 2 Ri 2
{code}
While adding a constraints as {{Tick( tick != null, $index : tick ) }} inside rule M and J
would result in the following rete:
{code:java}
[EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
[ObjectTypeNode(7)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Tick] expiration=-1ms ] on Partition(MAIN)
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li -1
Rd 0 Ri 0
[RuleTerminalNode(9): rule=Update] on Partition(2) d -1 i -1
[AlphaNode(10) constraint=tick != null] on Partition(3) d 2 i 2
[LeftInputAdapterNode(11)] on Partition(3) Ld 0 Li 0
[ AccumulateNode(13) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[RuleTerminalNode(14): rule=M] on Partition(3) d -1 i -1
[ AccumulateNode(15) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[RuleTerminalNode(16): rule=J] on Partition(3) d -1 i -1
[ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
[RuleTerminalNode(4): rule=Init] on Partition(1) d -1 i -1
[ObjectTypeNode(5)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=java.lang.Integer] expiration=-1ms ] on Partition(MAIN)
[LeftInputAdapterNode(6)] on Partition(2) Ld 0 Li 0
[JoinNode(8) - [ClassObjectType class=org.test.Tick]] on Partition(2) Ld -1 Li
-1 Rd 0 Ri 0
[ObjectTypeNode(12)::EntryPoint::DEFAULT objectType=[ClassObjectType
class=org.test.Data] expiration=-1ms ] on Partition(MAIN)
[ AccumulateNode(13) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
[ AccumulateNode(15) ] on Partition(3) Ld 0 Li 2 Rd 2 Ri 2
{code}
beside the additional alpha node, kindly notice the AccumulateNode are having the Left
Inferred mask correctly populated.
Mask should reflect properties accessed in other nodes join
constraints
-----------------------------------------------------------------------
Key: DROOLS-1445
URL:
https://issues.jboss.org/browse/DROOLS-1445
Project: Drools
Issue Type: Bug
Components: core engine
Reporter: Matteo Mortari
Assignee: Mario Fusco
The following test exhibit a failing and a working test:
{code:java}
@Test()
public void testAbis_NotWorking() {
// DROOLS-644
String drl =
"import " + Person.class.getCanonicalName() + ";\n"
+
"global java.util.List list;\n" +
"rule R when\n" +
" $p1 : Person( name == \"Mario\" ) \n" +
" $p2 : Person( age > $p1.age ) \n" +
"then\n" +
" list.add(\"t0\");\n" +
"end\n" +
"rule Z when\n" +
" $p1 : Person( name == \"Mario\" ) \n" +
"then\n" +
" modify($p1) { setAge(35); } \n" +
"end\n"
;
// making the default explicit:
KieSession ksession = new
KieHelper(PropertySpecificOption.ALWAYS).addContent(drl, ResourceType.DRL)
.build()
.newKieSession();
ksession.addEventListener(new DebugAgendaEventListener());
System.out.println(drl);
ReteDumper.dumpRete(ksession);
List<String> list = new ArrayList<String>();
ksession.setGlobal("list", list);
Person mario = new Person("Mario", 40);
Person mark = new Person("Mark", 37);
FactHandle fh_mario = ksession.insert(mario);
ksession.insert(mark);
int x = ksession.fireAllRules();
assertEquals(1, list.size());
assertEquals("t0", list.get(0));
}
@Test()
public void testAbis_Working() {
// DROOLS-644
String drl =
"import " + Person.class.getCanonicalName() + ";\n"
+
"global java.util.List list;\n" +
"rule R when\n" +
" $p1 : Person( name == \"Mario\", $a1: age) \n"
+
" $p2 : Person( age > $a1 ) \n" +
"then\n" +
" list.add(\"t0\");\n" +
"end\n" +
"rule Z when\n" +
" $p1 : Person( name == \"Mario\" ) \n" +
"then\n" +
" modify($p1) { setAge(35); } \n" +
"end\n"
;
// making the default explicit:
KieSession ksession = new
KieHelper(PropertySpecificOption.ALWAYS).addContent(drl, ResourceType.DRL)
.build()
.newKieSession();
System.out.println(drl);
ReteDumper.dumpRete(ksession);
List<String> list = new ArrayList<String>();
ksession.setGlobal("list", list);
Person mario = new Person("Mario", 40);
Person mark = new Person("Mark", 37);
FactHandle fh_mario = ksession.insert(mario);
ksession.insert(mark);
int x = ksession.fireAllRules();
assertEquals(1, list.size());
assertEquals("t0", list.get(0));
}
{code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)