[jboss-jira] [JBoss JIRA] Commented: (JBRULES-909) java.lang.ClassCastException: org.drools.rule.AbstractCompositeConstraint$MultiFieldOrConstraintContextEntry
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Thu Jun 14 14:30:11 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-909?page=comments#action_12365415 ]
Edson Tirelli commented on JBRULES-909:
---------------------------------------
This was commented in IRC... check if it is the same case:
-----------------
After asserrting the following objects and performing the rule I get the error shown
PersonSummary personSummary = new PersonSummary();
personSummary.setPrId(new Long(217));
personSummary.setCmpntCd(new Character('R'));
PersonSummary personSummary2 = new PersonSummary();
personSummary2.setPrId(new Long(217));
personSummary2.setCmpntCd(new Character('G'));
##################################
rule "Duplicate Projection for same processing date by another component"
when
$j : PersonSummary($prId : prId, $cmpntCd : cmpntCd)
exists PersonSummary(this != $j, cmpntCd == $cmpntCd)
then
System.out.println("Error Found in rule Duplicate Component Code");
end
##################################
java.lang.ClassCastException: org.drools.rule.VariableRestriction$ObjectVariableContextEntry
at org.drools.base.evaluators.CharacterFactory$CharacterEqualEvaluator.evaluateCachedRight(CharacterFactory.java:99)
at org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:78)
at org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:78)
at org.drools.common.DoubleBetaConstraints.isAllowedCachedRight(DoubleBetaConstraints.java:149)
If I change the exists rule to:
exists PersonSummary(this != $j, cmpntCd == 'A')
it works fine.
Is there something I have to do to compare two char objects.
Thanks
> java.lang.ClassCastException: org.drools.rule.AbstractCompositeConstraint$MultiFieldOrConstraintContextEntry
> ------------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-909
> URL: http://jira.jboss.com/jira/browse/JBRULES-909
> Project: JBoss Rules
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Reteoo
> Affects Versions: 4.0.0.MR3
> Reporter: Dirk Bergstrom
> Assigned To: Edson Tirelli
>
> When asserting User objects into the a WM that has already had rules fired, I get this exception:
> java.lang.ClassCastException: org.drools.rule.AbstractCompositeConstraint$MultiFieldOrConstraintContextEntry
> at org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestriction.java:72)
> at org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstraint.java:72)
> at org.drools.rule.OrConstraint.isAllowedCachedLeft(OrConstraint.java:64)
> at org.drools.common.DoubleBetaConstraints.isAllowedCachedLeft(DoubleBetaConstraints.java:140)
> at org.drools.reteoo.CollectNode.assertTuple(CollectNode.java:137)
> at org.drools.reteoo.CompositeTupleSinkAdapter.propagateAssertTuple(CompositeTupleSinkAdapter.java:30)
> at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:155)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:317)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:183)
> at org.drools.reteoo.Rete.assertObject(Rete.java:121)
> at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:201)
> at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(ReteooWorkingMemory.java:70)
> at org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemory.java:766)
> at org.drools.common.AbstractWorkingMemory.assertObject(AbstractWorkingMemory.java:578)
> at net.juniper.dash.data.DataSource.reconcileAssertedRecords(DataSource.java:265)
> at net.juniper.dash.data.UserSource.populateRecords(UserSource.java:234)
> at net.juniper.dash.Updater$DataSourceProcessor.work(Updater.java:177)
> at net.juniper.dash.Refresher.run(Refresher.java:69)
> I assert a bunch of Users (and a bunch of other objects), then fire the rules, then attempt to assert more Users, and I get this on the *second* User I assert.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list