The "t" router isn't special in any way; it can be reassigned just
like any other router, as described in manual section 4.4.6. You might
want to save and restore it; something like

(bind ?t (call (engine) getOutputRouter "t"))
(open myfile.txt t "w")
(show-deftemplates)
(close t)
(call (engine) addOutputRouter "t" ?t)

Note that many functions like (show-deftemplates) are trivial
fucntions written in the  Jess language itself; find them in
jess/scriptlib.clp. Here is show-deftemplates from Jess 6.0a5:

(deffunction show-deftemplates ()
  "Print deftemplates using Java reflection"
  (bind ?__e (call (engine) listDeftemplates))
  (while (call ?__e hasNext)
    (printout t crlf (call (call ?__e next) toString) crlf)))     

You could write your own version that outputs to a file, or takes a
router name as an argument.



I think Archana Raghavendra wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
>      Is there any way in Jess that one can change the standard default output from 
>'t' router to another router (say a file) . For Example, suppose I want the output of 
> (show-deftemplates) to go to a file instead of the standard output. Is there any way 
>I could go about this?
> 
> Thanks,
> Archana



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

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