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

Declarations from "declare" sections don't apply to sub-classes if those live in a different package

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 5.4.0.Final
    • drools-compiler
    • None

    Description

      Declarations (like @role(event) ) in a declare-Section should apply to sub-classes of the declared class, too, but don't if the sub-class resides in a different package than the base class.

      Attached you'll find an example which demonstrates the issue. The class ButtonEvent derives from VSCPEvent which is declared with @role(event). Running com.levigo.overlord.DroolsTest yields a java.lang.ClassCastException: org.drools.common.DefaultFactHandle which is caused by the ButtonEvent not being recognized as an event instead of a fact.

      The Problem goes away if ButtonEvent is declared as an event (uncomment the section in overlord.drl or ButtonEvent is moved to the same package as VSCPEvent.

      For more information see the referenced forum thread.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            hennejg_jira Jörg Henne (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty