[jboss-jira] [JBoss JIRA] Created: (JBRULES-1208) Errors for some OR junctions in LHS conditional elements

Bryan Rickman (JIRA) jira-events at lists.jboss.org
Wed Sep 19 16:29:12 EDT 2007


Errors for some OR junctions in LHS conditional elements
--------------------------------------------------------

                 Key: JBRULES-1208
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1208
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 4.0.1
         Environment: JBoss Rules 4.0.1, Java 1.5, Windows XP SP2
            Reporter: Bryan Rickman
         Assigned To: Mark Proctor


rule "6040 Pass CA Fees" 
        when 
                #conditions 
                $status : ValidationPassFailStatus() 
                exists ValidationControl(validationNo == 6040) 
                CiLines($ciNo : ciNo, $ciLineNo : ciLineNo,	$countryOrigin : countryOrigin) 
                Country(country == $countryOrigin, canadianProvince != "", canadianProvince != "N") 
                (CiLineFees(amtFee == 0, ciNo == $ciNo, ciLineNo == $ciLineNo) 
                or not CiLineFees(ciNo == $ciNo, ciLineNo == $ciLineNo)) 
        then 
                #actions 
                System.out.println("6040 Pass CA Fees"); 
                $status.passSq(6040);	
end 

I have tried this with and without the parenthesis for explicitness.  It errors out when inserting facts for the rule: 

java.lang.ClassCastException: com.kewill.icustoms.customs.rules.model.ValidationPassFailStatusShadowProxy 
        at org.drools.base.com.kewill.icustoms.dbi.model.CiLines$getCountryOrigin.getValue(Unknown Source) 
        at org.drools.base.extractors.BaseObjectClassFieldExtractor.getHashCode(BaseObjectClassFieldExtractor.java:139) 
        at org.drools.base.ClassFieldExtractor.getHashCode(ClassFieldExtractor.java:173) 
        at org.drools.rule.Declaration.getHashCode(Declaration.java:272) 
        at org.drools.util.AbstractHashTable$SingleIndex.hashCodeOf(AbstractHashTable.java:489) 
        at org.drools.util.TupleIndexHashTable.getOrCreate(TupleIndexHashTable.java:280) 
        at org.drools.util.TupleIndexHashTable.add(TupleIndexHashTable.java:192) 
        at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:111) 
        ... 

However, if I break the exact same code manually into two separate rules, it works fine.

-- 
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