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

nested accessors on the lhs of the memberOf (or not memberOf) operator lead to an exception

    XMLWordPrintable

    Details

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

      Windows XP, Java 1.5, Drools 4.0.0.GA

    • Estimated Difficulty:
      Medium

      Description

      nested accessors on the lhs of the memberOf (or not memberOf) operator lead to an exception:

      business logic (pseudocode):

      class Position {
      private Instrument instrument;
      }
      class Instrument {
      private Currency currency;
      }

      with getters and setters.

      rule:

      $collection : Collection()
      $position : Position(instrument.currency not memberOf $collection)

      exception:

      org.drools.RuntimeDroolsException: Exception executing predicate org.drools.base.mvel.MVELPredicateExpression@1f99eea
      at org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:212)
      at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:110)
      at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:119)
      at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
      at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:162)
      at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:317)
      at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168)
      at org.drools.reteoo.Rete.assertObject(Rete.java:168)
      at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
      at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:848)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:822)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:623)
      at test.RuleTest.testRuleEngine1(RuleTest.java:99)
      Caused by: java.lang.ClassCastException: test.Currency
      at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:36)
      at org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:206)
      ... 33 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                aki07 andreas kinell
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 hours
                  5h
                  Remaining:
                  Remaining Estimate - 5 hours
                  5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified