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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.4.0.Final
    • Fix Version/s: None
    • Component/s: drools-compiler
    • Labels:
      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

            Assignee:
            mfusco Mario Fusco
            Reporter:
            hennejg Jörg Henne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: