Description
When creating the following rule:
rule forwardRequest
//no-loop true
when
exists(RulesFact(fact == Facts.PC_STATUS_UPDATED))
exists(RulesFact(fact == Facts.PC_DISABLED)) || exists(RulesFact(fact == Facts.PERFORMED_REQUEST_PC))
not(RulesFact(fact == Facts.REQUEST_DENIED))
not(ClientHttpResponse())
not(RulesFact(fact == Facts.ABORT_REQUEST_ERROR))
then
operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.executeRequest.ExecuteRequestOperation",context);
assert(new RulesFact(Facts.REQUEST_FORWARDED_TO_THE_INTERNET));
end
The following exception is thrown:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.newWorkingMemory(Unknown Source)
at org.drools.common.AbstractRuleBase.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.admin.RuleExecutionSetImpl.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.AbstractRuleSessionImpl.newWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.AbstractRuleSessionImpl.initWorkingMemory(Unknown Source)
at org.drools.jsr94.rules.StatefulRuleSessionImpl.<init>(Unknown Source)
at org.drools.jsr94.rules.RuleRuntimeImpl.createRuleSession(Unknown Source)
at com.flash.ruleEngine.RulesSessionFactoryImpl.createStatefulRuleSession(RulesSessionFactoryImpl.java:55)
Moving the condition with the | in it to the top of the conditions list, the rules are compiled fine, but during the execution of the rules, the consequence of the following rule fails:
rule updateTransactionInfo
when
exists(RulesFact(fact == Facts.USER_DATA_UPDATED))
then
operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.updateTransaction.UpdateTransactionInfoOperation",context);
assert(new RulesFact(Facts.TRANSACTIONS_DATA_UPDATED));
end
With the exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
at org.drools.reteoo.TupleKey.get(Unknown Source)
at org.drools.reteoo.ReteTuple.get(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.NotNode.retractObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateRetractObject(Unknown Source)
at org.drools.reteoo.RightInputAdapterNode.retractTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateRetractTuple(Unknown Source)
at org.drools.reteoo.NotNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
at com.flash.httpProxy.Rule_updateTransactionInfo_0.consequence(Rule_updateTransactionInfo_0.java:13)
at com.flash.httpProxy.Rule_updateTransactionInfo_0ConsequenceInvoker.evaluate(Rule_updateTransactionInfo_0ConsequenceInvoker.java:20)
I have this issue with version 3.0.1, upgrading to version 3.0.5 did not solve this issue.
I have looked through the site and found the following jira :
Which seems to be talking about the same problem, however it was supposed to be fixed on 3.0 RC2 , so i am not sure if the issues are related.
If you need any more details, please let me know.
thanks,
Tomer