Russ,
Double-check the "extends" optional phrase in your defclass calls
(and/or "from-class" declarations in deftemplate declarations).
- Mike Smith
On May 18, 2008, at 8:03 AM, [EMAIL PROTECTED] wrote:
I have the following class structure
IInterface1
getName()
IInterface2 extends IInterface1
getValue()
AbstractClassA implements IInterface2
ClassB extends AbstractClassA,
ClassC extends AbstractClassA
ClassD implements IInterface2
All 3 concrete classes implement IInterface2 and expose "getName".
I'd like to write a Rule that matches a fact of any of the 3 concrete
classes (B, C, and D). I use the defclass construct for the various
types and interfaces and add 3 facts, one of each of the 3 concrete
classes.
Two issues arise:
First, when I try the following rule:
?x <- (IInterface2 (name ?name)) => (printout t \"Found an
IInterface2 called \" ?name crlf)
"Message: No such slot name in template MAIN::Interface2 at token
'name'." I only get this error on IInterface2.
If I write comparable rules for all of the types and run them, only
the
rules matching the concrete classes match. E.g.
?x <- (AbstractClassA (name ?x_name) (OBJECT ?x_obj)) does not
match but
?x <- (ClassB (name ?x_name) (OBJECT ?x_obj)) does (only the one
instance of course).
What's the best way handle this type of situation? I can send a zip
with
sample code if that helps. Thanks.
-Russ
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users
[EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify owner-jess-
[EMAIL PROTECTED]
--------------------------------------------------------------------
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------