Uploaded image for project: 'JBoss BRMS Platform'
  1. JBoss BRMS Platform
  2. RHBRMS-2433

[GSS](6.3.x) ClassCastException when modify an fact involved in an 'or' condition in BRMS 6.3.x

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.1.GA
    • 6.3.0.GA
    • BRE
    • CR1

      Description of problem:

      A ClassCastException is thrown by trying to use OR condition in when part as follows:

      rule "sample"
      no-loop
      when
      $tx: (Text (id=='foo') or Text (id=='bar'))
      $m: Message()
      then
      modify($m)

      {setText($tx)}

      ;
      end

      However, it works well if using "||". The exact same rule above works well in BRMS 6.2.x.

      Version-Release number of selected component (if applicable):
      6.3.0

      How reproducible:
      Always

      Steps to Reproduce:
      1. Create a sample rule like the one above;
      2. Try to run it by using BRMS 6.3.0 libraries;

      Actual results:

      Caused by: java.lang.ClassCastException: com.sample.Message cannot be cast to org.drools.core.common.InternalFactHandle
      at org.drools.core.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:398)
      ...

      Expected results:
      It should work well as it work in 6.2.

      Additional info:

      A workaround would be to split the rule or use "||" as follows:

      $tx: Text (id=='foo' || id=='bar')

      KCS Solution
      "ClassCastException" when modifying a fact involved in an 'or' condition in BRMS 6.3.x

            mfusco@redhat.com Mario Fusco
            rhn-support-ajuricic Amana Juricic
            Archiver:
            rhn-support-ceverson Clark Everson
            Tibor Zimányi Tibor Zimányi
            Tibor Zimányi Tibor Zimányi

              Created:
              Updated:
              Resolved:
              Archived: