ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
by Paul Ryan
Hi all,
We're receiving some error messages that we don't understand from rules that had conditionals that worked and now don't (no upgrade or anything like that, they just stopped working), any clues as to what kinds of things to look for when we get an error like the following? (if not we can try to pair down to an a test case)
org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:353)
at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:406)
at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:370)
at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
Caused by: java.lang.ClassCastException: org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:159)
at org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:68)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:231)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1360)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:141)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:154)
at com.infotrustgroup.what.Rule_Transform_SGML_to_XML_0.consequence(Rule_Transform_SGML_to_XML_0.java:48)
at com.infotrustgroup.what.Rule_Transform_SGML_to_XML_0ConsequenceInvoker.evaluate(Rule_Transform_SGML_to_XML_0ConsequenceInvoker.java:34)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 11 more
Thanks in advance for your help with this,
-- Paul Ryan
16 years
Any news on Drools 5.1
by Chuck Irvine
I am planning on diving into a Drools based workflow related project pretty
soon and have kind of been waiting for 5.1 to come out (or maybe the next
milestone release). Any news on 5.1 availability? Thanks -Chuck
16 years
Drools + ETL Process
by andre.fonseca@mail.com
Hi all,
I am using Drools 5.0 with Tomcat 6 and MySQL.
Now I need to insert data in the drools database but I DON'T want to use the Guvnor interface.
This is because in the future we'll need to use a kind of ETL process to populate the drools database.
Should I create a java class with JDBC access and perform a SQL direct to that tables?
I did the reverse engineering of the drools database but I could not understood yet where the data are persisted.
Any advice should be very helpful.
Thanks in advance.
16 years
How to make this rule more memory efficient?
by Ryan Fitzgerald
Hi,
Can anyone advise me on how to make a drools rule more memory efficient? Here is the problem:
I have a Cell and a ProxyCell object classes.
The ProxyCell represents the Cell when their internal ID's match.
Each Cell and ProxyCell however has a unique name (not same as ID).
A Cell can reference (by name) a ProxyCell (as long as the ProxyCell does not represent that actual Cell - which would effectively be a self-reference and is not allowed).
What I want to do is find out where I have a reference from any instance of Cell - cell1 - to any instance of ProxyCell - proxycell2 - but am missing a reference from cell2 to proxycell1 where proxycell2 is a representation of cell2 and proxycell1 is a representation of cell1.
Here is the rule I have written for it:
rule "Check consistent references"
when
$cell1 : Cell()
$cell2 : Cell()
$proxycell1 : ProxyCell ( id = $cell1.id, $cell2.references contains this.name )
$proxycell2 : ProxyCell ( id = $cell2.id, $cell1.references not contains this.name )
then
//report an error.....
end
I have 10,000 instances of Cell and 10,000 instances of ProxyCell in working memory. For each instance of Cell, it can have references to 60 different ProxyCell instances. Loading the Cell and ProxyCell instances into working memory is not a problem. However, when I try to run this rule above, the memory quickly goes above 1GB and I eventually get an out of memory error.
I was wondering if there is a better way to structure or write this rule so that it doesn't use so much memory.
Thanks,
Ryan.
16 years
Flow - handling multiple events of the same kind
by Ed Staub
If the same event-node is triggered twice with different data, the same
variable will be recycled for the different data payloads. How does one
ensure that data is not lost?
My best guess is to follow the event node with a composite node, and copy
the top-level variables into the composite's variable scope in the first
sub-node of the composite. But I'm not sure whether I can guarantee that
the composite will be able to do that before the engine handles the second
event.
Suggestions?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Flow-handling-multipl...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years, 1 month
Problem with the Decision table
by Manikandan
Hi
Below is the code i use to run the rules in the decision table. I am
inserting the empty even object into the session but i still get the "Cannot
be resolved issues". I have attached my decison table as well. Am new to
DRools, so please help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecisionTableConfiguration dtableconfiguration = KnowledgeBuilderFactory.*
newDecisionTableConfiguration*();
dtableconfiguration.setInputType( DecisionTableInputType.*XLS* );
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*();
kbuilder.add( ResourceFactory.*newClassPathResource*(
"RFC36877ScenarioDT.xls",
getClass() ),
ResourceType.*DTABLE*,
dtableconfiguration );
*if* ( kbuilder.hasErrors() ) {
System.*err*.print( kbuilder.getErrors() );
*return* -1;
}
KnowledgeBase kbase = KnowledgeBaseFactory.*newKnowledgeBase*();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
// typical decision tables are used *statelessly
*
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
//now create some test data
Input input = *new* Input();
System.*out*.println("creating the event...");
BusinessEvent event = *new* BusinessEvent();
ksession.execute( Arrays.*asList*( *new* Object[]{input, event} ) );
System.*out*.println( "Business events " + event.getEvents());
*return* 0;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks
Manikandan
16 years, 1 month
rules not wrking
by Puneet duggal
frnds i have a rule
and its not working and i for checking i have put a Sop in my when but it
not prints the
Inside Area_SqFt_1_10-01-09_12-31-14
so how can we put SOP inside when clause.
rule "Area_SqFt_1_10-01-09_12-31-14"
date-effective "01-Oct-2009" date-expires "31-Dec-2014" salience 6
no-loop true
when
System.out.println("Inside Area_SqFt_1_10-01-09_12-31-14");
objectP2483 : Para_2483( (fid2335=="Block") && (fid2336==16) );
then
System.out.println("Area_SqFt_1_10-01-09_12-31-14");
objectP2483.setFid31003(new Double(497)); end
16 years, 1 month