Hello, learning fast, but still need help:-)

Considering I chose to go 100% Java for the knowledge base (e.g. Only
definstance objects) I have a problem when doing more than simple matching
in the LHS of a rule.

Consider (this is a simplified version of the real case of course):

(defrule startupRule1
    (Session
        (readyToRun TRUE)
        (currentStateName "START")
        (OBJECT ?x)
    )
    =>
    (call ?x initializeSession)

I use a readyToRun to avoid rules being fired by the run command of another
user since many users may be sharing a same application instance. The
Session object is private to each user. The run command is executed once at
the end of each user action (somewhat in the middle of a request response
loop).
So this works fine.

However, I now need to do some more complex matching. Imagine I have a User
object in my session and what to do something like:

(defrule startupRule1
    (Session
        (readyToRun TRUE)
        (currentStateName "START")
        (user (name "Alex"))
        (OBJECT ?x)
    )
    =>
    (call ?x setAdminMode)

The user object is an attribute of my session. The user class has been
defined. But loading the rule, Jess tells me "bad slot value" (user is a
watched attribute and name is an attribute of user). I would really like to
avoid writing "cover methods" for every object contained in my session
object.

Later on, I would also like to test against multislot in the sense of having
an ArrayList in my session object and do matching such as "if at least one
of the object in the list is xyz then do something" or "find the first
object in the list with xyz and take its value to compute something".

I tried looking into the documentation and even earlier in this list, but
nothing really helped me... Maybe it is an obvious solution, but I am still
too much of a beginner to find out!

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