The modify function expects at least two parameters: the first is the fact to
be modified and the rest are slot name and modification value pairs. If your
Java code has the fact-id, then it could be inserted into the string passed to
executeCommand (which is deprecated in 7.0 for eval). For instance, if the
fact-id for o_id==90 were 20090, then
r.eval("(modify 20090 (o_description NoKnife))");
should work.
A Jess query could look up the fact within a function:
(defquery object-id-query
"Look up fact id."
(declare (variables ?id))
?fact <- (objects (o_id ?id)))
(deffunction modify-object-description
"Modify objects instance description"
(?id ?description)
(bind ?results (run-query* object-id-query ?id))
(?results next) ; Assumes exactly one objects instance with ?id
(modify (?results get fact) (o_description ?description))
(close ?results)
nil)
then run
r.eval("(modify-object-description 90 NoKnife)");
Bob Kirby
At 04:19 AM 7/17/2007, M Ismail wrote:
>Hi,
>i am using a template:
>
>(deftemplate objects
>(slot o_id)
>(slot o_description)
>(slot o_is_visible)
>(slot o_makes_sound)
>(slot o_sound_volume)
>(slot o_framenumber)
>)
>
>and i want to modify the o_decription of the object with o_id = 90
>how can i do that? if i use:
>
>r.executeCommand("(modify (objects (o_id 90) (o_description NoKnife)))");
>
>then i get errors and it doesnt work
>
>best regards,
>M. Ismail
>
>_________________________________________________________________
>Het meest spraakmakende nieuws vind je op www.msn.nl http://www.msn.nl
--------------------------------------------------------------------
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]
--------------------------------------------------------------------