[
https://issues.jboss.org/browse/JBRULES-3587?page=com.atlassian.jira.plug...
]
Jörg Henne updated JBRULES-3587:
--------------------------------
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.
was:
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.
Forum Reference:
http://drools.46999.n3.nabble.com/Apply-role-to-whole-class-hierarchy-td4...
(was:
http://drools.46999.n3.nabble.com/Apply-role-to-whole-class-hierarchy-td4...)
Declarations from "declare" sections don't apply to
sub-classes if those live in a different package
----------------------------------------------------------------------------------------------------
Key: JBRULES-3587
URL:
https://issues.jboss.org/browse/JBRULES-3587
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler
Affects Versions: 5.4.0.Final
Reporter: Jörg Henne
Assignee: Mark Proctor
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira