[
https://issues.jboss.org/browse/JBRULES-3632?page=com.atlassian.jira.plug...
]
Michal Bali updated JBRULES-3632:
---------------------------------
Attachment: test-case.zip
attached test-case.zip, it contains minimal maven project for reproducing this
run 'mvn eclipse:eclipse', then execute Main class IndexingProblemMain and observe
the exception
UnsupportedOperationException on fireAllRules call
--------------------------------------------------
Key: JBRULES-3632
URL:
https://issues.jboss.org/browse/JBRULES-3632
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler (expert), drools-core (expert)
Affects Versions: 5.4.0.Final, 5.5.0.Beta1
Reporter: Michal Bali
Assignee: Mark Proctor
Attachments: test-case.zip
Hi,
I am getting the following exception when calling fireAllRules:
Exception executing consequence for rule "ruleThatFails" in
indexingproblem.remove.me.anditworks: java.lang.UnsupportedOperationException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1212)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1446)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at com.mycompany.app.IndexingProblemMain.main(IndexingProblemMain.java:36)
Caused by: java.lang.UnsupportedOperationException
at org.drools.reteoo.BaseLeftTuple.getPrevious(BaseLeftTuple.java:480)
at org.drools.core.util.index.LeftTupleList.remove(LeftTupleList.java:114)
at org.drools.core.util.index.LeftTupleList.removeAdd(LeftTupleList.java:68)
at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:310)
at org.drools.reteoo.LeftTupleSource.doModifyLeftTuple(LeftTupleSource.java:304)
at org.drools.reteoo.LeftTupleSource.modifyLeftTuple(LeftTupleSource.java:278)
at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:437)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateModifyLeftTuple(SingleLeftTupleSinkAdapter.java:205)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyObject(SingleLeftTupleSinkAdapter.java:235)
at org.drools.reteoo.LeftInputAdapterNode.modifyObject(LeftInputAdapterNode.java:170)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateModifyObject(SingleObjectSinkAdapter.java:68)
at org.drools.reteoo.AlphaNode.modifyObject(AlphaNode.java:157)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:507)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:421)
at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:314)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:265)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:483)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:383)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:337)
at
indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96ca.defaultConsequence(Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96ca.java:9)
at
indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96caDefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at
indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96caDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1277)
... 6 more
I have tried to create a minimal test case that recreates this issue, here it is:
package indexingproblem.remove.me.anditworks;
declare Criteria
processed : boolean
end
declare CheeseCriteria extends Criteria
end
rule setUp
salience 10000
when
then
insert(new CheeseCriteria());
end
rule aaa
when
CheeseCriteria( )
then
end
rule bbb
when
CheeseCriteria( )
then
end
rule ccc
when
CheeseCriteria( )
then
end
rule eeeFalse
when
Criteria( processed == false )
then
end
declare Filter
end
rule fffTrue
when
Criteria( processed == true )
Filter( )
then
end
rule ruleThatFails
when
$criteria : Criteria( processed == false )
then
modify($criteria) {
setProcessed(true)
}
end
This is working fine with 5.3.0.Final. But it is failing with 5.4.0.Final and also
5.5.0-SNAPSHOT. Note that if you change the rule package to be "package
indexingproblem" the exception is not thrown. The code for building the KnowledgeBase
is standard, I haven't used any additional options. No fact is inserted only one
fireAllRules call.
Thanking you.
Best regards,
Michal
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira