Hello,

I use definstance for a "context" object in Java. However, several other
objects will be used in the LHS of the rule but don't exist as a
definstance. I suppose, that's ok.

Now, my understanding is that if you want to match the head of a rule with a
java object, it needs to be a definstance. eg:

(Defrule rule1
    (myObject
        (thisIsOne 1)
    )
    =>
    do something...
)

MyObject has to be a definstance.
However, anything "inside" doesn't need to. Eg:

(Defrule rule1
    (myObject
        (user ?x & :(eq "Alex" (get ?x name)))
    )
    =>
    do something...
)

My question is: does the ":" (the function call) get evaluated each time or
is the value cached (like if myObject was not a dynamic object notifying of
changes, user would be cached and a change in user would not be known to the
Jess engine).
In this case, if the name changes, do I need to fire a property change in
user or does the "eq" and the "get" get evaluated all the time?

Huh, I hope this was clear enough?

It is really getting down to:

- when should a Java object which will be used in a Jess engine be asserted
with a definstance?
- when should a Java object which will be used in a Jess engine have a
propertyChangeSupport mechanism (considering I don't want "outdated" values
in my Rete engine, but always the values actually in my objects?

Thanks,

Alex

-- 
Alexander Lamb 
Groupe Serveurs Applicatifs
Division d'Informatique Midicale
Htpitaux Universitaires de Genhve
21 rue Micheli-du-Crest
CH-1211 Genhve 4 / Switzerland
Tel: +41-22 372.48.46 Fax: +41-22 382.86.80
[EMAIL PROTECTED] / http://www.hcuge.ch

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