Startup and Shutdown Tcl Scripts
Workspace Parameters > Scripting > Startup Tcl Script, Shutdown Tcl Script
You can integrate and run a Tcl script by accessing these parameters.
Potential uses of such scripts are:
• To check a database connection before running the translation.
• To move data prior to or after the translation
• To write the translation results to a custom log or e-mail them to an administrator
Note: For more information, see FME_BEGIN_TCL and FME_END_TCL.
Startup Tcl Script
This setting allows a Tcl script file to execute just prior to the start of translation. The script is executed after the mapping file has been completely parsed, and after the logfile has been opened, but before any of the readers or writers have begun to do their processing.
Note: FME will abort the translation if the execution of FME_BEGIN_TCL scripts fails. If, for some reason, this behavior is undesirable and you want to continue a translation even if the execution fails, you can add a Tcl catch command in your Tcl script – this will catch any errors and FME will continue with the translation.
Shutdown Tcl Script
This setting allows a Tcl script file to execute just after translation has completed, either successfully or prematurely due to an error being encountered.
If the translation ended due to an error, the script is executed after all cleanup is done, all reader and writers are shut down, and the logfile has been closed. If the translation was successful, the script is executed after all the the readers and writers have finished their work, and the logfile has been closed.