Hi,
I am using Jess60b3.
I am working with Jess in a configuration where Jess is an embedded component of the 
application.
In the application there are several inheritance hierarchies which I have access to 
and do several defclasses and definstances on.

My questions are:
If a have an inheritance relation on the Java side between two or more classes, is the 
inheritance relation automatically reflected in JESS to the deftemplates created when 
I do a defclass on both the superclass and subclasses or must I explicitly state the 
realtionships also in Jess? I think I have managed without the trailing "...extends 
SuperClassName)" earlier (also in Jess60b3) but I am unable to repeat it.  I think I 
managed to do it with a bean-style class with a beaninfo class but as can be seen from 
below the classes I must use are static.

What I want to achive is a rule which pattern matches the superclass but then examines 
through tests which type of instance really matched the LHS and use this data when 
testing other patterns if they should match the LHS.

A short example to clarify things:

(defclass SuperClassName FOO.bar.SuperClassName)
(defclass SubClassName1 FOO.bar.SubClassName1)
(defclass SubClassName2 FOO.bar.SubClassName2)

(definstance FOO.bar.SubClassName1 ?subClassName1Instance static) 
(definstance FOO.bar.SubClassName2 ?subClassName2Instance static)


(defrule subClassMatch
"Rule that matches all facts which are subclasses of SuperClassName"
superClassFact <-(SuperClassName (class ?class) (OBJECT ?object))
=>
(printout t (str-cat "Matched a fact of class " (call ?class getName))))

/best regards

Mikael Rundqvist


--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to