[rules-users] Problem Comparing to Character Fields

Edson Tirelli tirelli at post.com
Sat Jun 16 10:06:30 EDT 2007


    This is a bug for sure. May I ask you please to open a JIRA for it?

     Thank you,
        Edson


2007/6/14, BrianKE <brianke at gmail.com>:
>
> 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.evaluateCac
> hedRight(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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070616/5fd9cbed/attachment.html 


More information about the rules-users mailing list