Bug 1032040

Summary: RETE-OO: CCE when using time or length windows
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0   
Target Milestone: ER6   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:19:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Maven project with reproducer none

Description Marek Winkler 2013-11-19 12:44:04 UTC
Created attachment 826037 [details]
Maven project with reproducer

Description of problem:

When using time or length windows in DRL with RETE, the following ClassCastException is thrown:

Exception executing consequence for rule "TestLengthWindow" in org.drools.reteoo.window: java.lang.ClassCastException: org.drools.reteoo.nodes.ReteQueryTerminalNode cannot be cast to org.drools.core.reteoo.RuleTerminalNode
	at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
	at org.drools.reteoo.common.ReteAgenda.fireActivation(ReteAgenda.java:1296)
	at org.drools.reteoo.common.ReteAgenda.fireNextItem(ReteAgenda.java:1202)
	at org.drools.reteoo.common.ReteAgenda.fireAllRules(ReteAgenda.java:1446)
	at org.drools.reteoo.common.ReteWorkingMemory.fireAllRules(ReteWorkingMemory.java:104)
	at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:932)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:256)
	at org.drools.reteoo.WindowTest.testLengthWindow(WindowTest.java:74)

Using PHREAK, the test passes.

Version-Release number of selected component (if applicable):

Drools 6.0.0-SNAPSHOT
BRMS 6.0.0 ER4

How reproducible:

Run WindowTest from the attached Maven project with setting drools engine to RETE:

mvn clean test -Dtest=WindowTest -Ddrools.ruleEngine=reteoo

The test passes, when executed with PHREAK:

mvn clean test -Dtest=WindowTest -Ddrools.ruleEngine=phreak

Actual results:

The test fails.

Expected results:

The test passes (as it does with PHREAK).

Comment 1 Mario Fusco 2013-11-27 14:06:00 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/41618d8b2

Comment 2 Marek Winkler 2014-01-07 16:05:52 UTC
Verified on BRMS 6.0.0 ER6.