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

using eval after using or causes ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.5, 5.0.0.M1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows XP, Linux,

      Description

      when using eval after using or the ClassCastException occurs.
      Here is a code of the rule causing classcast :

      when
      CccObject()
      BbbObject($bbb:bbb)
      $aaa:AaaObject(aaa==$bbb)
      or
      AaaObject(aaa=="ccc")

      eval($aaa.getAaa().equals($bbb))
      then
      System.out.println( "Success!!" );

      end

      here is the stacktrace:

      org.drools.RuntimeDroolsException: java.lang.ClassCastException: com.sample.CccObjectShadowProxy cannot be cast to com.sample.BbbObject
      at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
      ...

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tirelli Edson Tirelli
                  Reporter:
                  jboboli27 Jan Boboli
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: