Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1208

Errors for some OR junctions in LHS conditional elements

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.0.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      JBoss Rules 4.0.1, Java 1.5, Windows XP SP2

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                wasabifan Bryan Rickman
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: