Hi Alex,

my understanding is that ?c are not the same. They would be the same if they
were in the same pattern, but here it is not the case. Try to view this rule
(eg. with view command) and you will see that each ?c get some prefixes to
make them unique.
I hope I'm right,
Waldek

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Alexander Lamb
Sent: 10 padziernika 2002 12:19
To: [EMAIL PROTECTED]
Subject: JESS: Rules firing in an endless loop...


Although I only have 5 rules, I get into a strange loop.

Here is the rule that fires continuously:

(defrule ASP1
    (OrmedContext
        (readyToRun TRUE)
        (task "script")
        (OBJECT ?c)
    )
    (CompleterResponseElement
        (ormedContext ?c)
        (key "ASP")
    )
    =>
    (bind ?s (new OrmedScript "ASP"))
    (call ?c setSelectedScript ?s)
    (call ?s addInstruction (new OrmedScriptInstruction "Aspirine Cardio
(100mg)" FALSE TRUE TRUE TRUE))
    (call ?s addInstruction (new OrmedScriptInstruction "Aspirine 500mg"
FALSE TRUE TRUE TRUE))
    (call ?s addInstruction (new OrmedScriptInstruction "Aspirine 1000mg"
FALSE TRUE TRUE TRUE))
)

My understanding is that ?c is the same. It is the way I found to avoid the
problem of bean properties which cant be null.
Here OrmedContext has a completerResponseElement, but it can be null.
Therefore, I do things the other way round:
When I set a completerResponseElement to my OrmedContext, I set the
ormedContext in CompleterResponseElement and
The latter is definstanced.

My rule means:

When a OrmedContext is readyToRun and task is script and has a
CompleterResponseElement with key is ASP
Then create a new OrmedScript, set it to OrmedContext then add three
instructions.

OrmedContext, CompleterResponseElement, OrmedScript are definstanced (in the
Java code). Only OrmedContext is dynamic.
When I add the new OrmedScript to OrmedContext I do:


undefinstance the previous one if it is not null
assign the ormedContext property to it
definstance the new selectedScript
fire property change for the selectedScript in OrmedContext


I am really puzzled because it seems so simple!

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