I am a real newbie having some difficulty understanding how I would
test/access
nested Java objects from the LHS of a rule.

Given the following declarations:
(deftemplate AgreementVO  (declare (from-class AgreementVO)))
(deftemplate HostVO (declare (from-class HostVO)))

A HostVO is contained within an AgreementVO and has
firstName and lastName attributes.

I can do this:

(defrule hostvo
    (AgreementVO (host ?host&:(neq ?host nil)))
    =>
    (bind ?ln (?host getLastName))
    (bind ?fn (?host getFirstName))
)

but this can be problematic if lastName or firstName is null, plus
I have some objects which are nested 3 deep.

I then found example code in the mailling list archives which
would define the rule as:

(defrule hostvo
    (AgreementVO (host ?host&:(neq ?host nil)))
    ?host <- (HostVO (lastName ?last)(firstName ?first))
    =>

Which doesn't fire at all. (I admit that even though I'm reading Jess In
Action
as well as the printed manual, I'm having trouble understanding this syntax
).

So my question is:  What is the correct method of accessing attributes of
nested
objects on the LHS of a rule?  Maybe pointers to JIA chapters or manual
chapters?

Thanks,
-
====================================
Darrel Davis                           [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
====================================

Reply via email to