-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
NEW
-
NEW
Modifying an object matched in a polymorphic way and using a window like in this test case:
@Test public void testModifySubclassOverWindow() { // DROOLS- String drl = "declare Number @role( event ) end\n" + "declare Integer @role( event ) end\n" + "\n" + "rule R1 no-loop when\n" + " $i: Integer()\n" + "then\n" + " update($i);\n" + "end\n" + "rule R2 when\n" + " $n: Number() over window:length(1)\n" + "then\n" + "end"; KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build( EventProcessingOption.STREAM ) .newKieSession(); ksession.insert(1); ksession.fireAllRules(); }
causes a CCE like the following:
java.lang.ClassCastException: org.drools.core.reteoo.WindowNode cannot be cast to org.drools.core.reteoo.BetaNode
at org.drools.core.reteoo.EntryPointNode.removeRightTuplesMatchingOTN(EntryPointNode.java:263)
at org.drools.core.reteoo.EntryPointNode.propagateModify(EntryPointNode.java:253)
at org.drools.core.reteoo.EntryPointNode.propagateModify(EntryPointNode.java:245)
at org.drools.core.phreak.PropagationEntry$Update.execute(PropagationEntry.java:217)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:93)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:83)
at org.drools.core.common.DefaultAgenda.flushPropagations(DefaultAgenda.java:1275)
at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:143)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:89)
at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:37)
at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1074)
at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1021)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1013)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1315)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1306)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1290)
at org.drools.compiler.integrationtests.PolymorphismTest.testModifySubclassOverWindow(PolymorphismTest.java:50)