You may also use deftemplate, e.g.
(deftemplate painting extends artifact (declare (from-class painting)))
The pros and cons for either form are discussed in the Jess manual, 5.3.1
Also note that, from Jess, you don't need to go the roundabout way using
OBJECT;
you can modify the slot in the Shadow Fact, and the Java object will be
updated
automatically.
-W
On Tue, Mar 31, 2009 at 9:15 PM, <[email protected]> wrote:
> I think the "extends" in the defclass is what you want.
>
> (defclass artifact artifact)
> (defclass painting painting extends artifact)
> (defclass statue statue extends artifact)
>
> -Russ
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of John Chrysakis
> Sent: Tuesday, March 31, 2009 11:50 AM
> To: [email protected]
> Subject: JESS: Inheritance in Deftemplates
>
>
> Hello again,
>
> I have the Java classes painting,statue which extend the class artifact.
> I need to model them in deftemplates in such a way that I could get both
> of instances with one defrule:
>
> (defrule checkAPP
>
> "Setting a property for all instances"
> (artifact (OBJECT ?art) )
>
> =>
> (?art setDatatypeProperty_1 "OK")
> (update ?art)
> )
>
>
> How I can do that?
>
> thanks in advance,
> John.
>
>
>
> --------------------------------------------------------------------
> 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].
> --------------------------------------------------------------------
>
>
>
> --------------------------------------------------------------------
> 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].
> --------------------------------------------------------------------
>
>