[
https://jira.jboss.org/jira/browse/JBRULES-2433?page=com.atlassian.jira.p...
]
Edson Tirelli closed JBRULES-2433.
----------------------------------
Resolution: Done
Facts with event roles in process constraints cause exception
-------------------------------------------------------------
Key: JBRULES-2433
URL:
https://jira.jboss.org/jira/browse/JBRULES-2433
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler, drools-core
Affects Versions: 5.1.0.M1
Reporter: Paul Borlin
Assignee: Edson Tirelli
Fix For: 5.1.0.M2
Attachments: Test.zip
When the following conditions are met, a runtime exception is thrown when the following
said type is inserted into working memory:
1. A ruleflow and rule definition are asserted into the knowledgebase
2. The rule definition declares a type as being an "event". (declare myType
@role( event ) @timestamp( value ) end )
3. The ruleflow references that type in a constraint.
4. A rule in the rule definition has a LHS constraint that references that type as an
event (i.e., code such as "over window:time( 12M )" is used)
Attached is a JUnit test that reproduces issue. The following stack trace is the
result:
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to
org.drools.common.EventFactHandle
at org.drools.rule.SlidingTimeWindow.updateNextExpiration(SlidingTimeWindow.java:198)
at org.drools.rule.SlidingTimeWindow.assertRightTuple(SlidingTimeWindow.java:120)
at org.drools.rule.BehaviorManager.assertRightTuple(BehaviorManager.java:88)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:186)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:337)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:184)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1093)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1044)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:829)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:233)
at com.company.RuleFlowTest.pepPostEvent(RuleFlowTest.java:83)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira