Hi all,
Does anyone know how to get the string version of a fact from a fact ID?
(i.e. that can be used with assert-string)
I don't see a function to do this in the function list.
I tried the following but it doesn't work:
(deftemplate test-fact (slot one) (slot two) )
(assert-string "(test-fact (one cat) (two dog))")
(defrule test-assert-string
?f<-(test-fact (one ?x) (two ?y))
=>
; get fact from fact ID. WHY DOES THIS FAIL?
; I assume (engine) returns the current Rete INSTANCE (doc is
not clear on this)
; It complains: Message: No overloading of method 'findFactByID'
?
(bind ?fct (call (engine) findFactByID ?f)) ;
; get string version of fact (is there a better way???)
(bind ?s (call ?fct toStringWithParens ))
(printout t " string fact = " ?s crlf)
; do something really meaningless to test
(retract ?f)
(assert-string ?s)
)
---------------------------------------------------------------------
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]
---------------------------------------------------------------------