Title: Still a problem when trying to match an object in an object...
Hello,

Some time ago, I asked about that question (August 30).
You replied but I didn’t get it to work, so I wrote:

I have the following rule:

(defrule ASP1
    (OrmedContext
        (readyToRun TRUE)
        (task "script")
        (selectedCompleterResponse ?r & :(eq "ASP" get ?r keyCode))
        (OBJECT ?x)
    )
    =>
    (bind ?s (new OrmedScript "Aspirine"))
    (call ?s addInstruction new OrmedScriptInstruction "Aspirine Cardio (100mg)" TRUE TRUE TRUE)
    (call ?s addInstruction new OrmedScriptInstruction "Aspirine 500mg" TRUE TRUE TRUE)
    (call ?s addInstruction new OrmedScriptInstruction "Aspirine 1000mg" TRUE TRUE TRUE)
    (call ?x setCurrentScript ?s)
)

The problem is that my LHS never evaluates to true (although I checked the values)... Now, last time you had
Suggested I use the following format:

        (selectedCompleterResponse ?r & :(eq "ASP" (get ?r keyCode)))

To match the value of the contained object (see the parenthesis around the get).
Unfortunately, the engine tells me “unknown slot keyCode”. But keyCode does exist in the selectedCompleterResponse
Class and the class is defined with a deffclass.

What is wrong here?

Thanks!
--
Alexander Lamb
Groupe Serveurs Applicatifs
Division d'Informatique Médicale
Hôpitaux Universitaires de Genève
21 rue Micheli-du-Crest
CH-1211 Genève 4 / Switzerland
Tel: +41-22 372.48.46 Fax: +41-22 382.86.80
[EMAIL PROTECTED] / http://www.hcuge.ch

Reply via email to