FME_END_TCL

The FME_END_TCL directive specifies a Tcl script to execute just after translation has completed, either successfully or prematurely due to an error being encountered.

If FME_END_TCL is followed by the FME_Decode token, the script is encoded in an internal FME format, as mentioned for FME_BEGIN_TCL.

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 log file 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 log file has been closed.

The script may access the following global Tcl variables, and any global variables set up in the FME_BEGIN_TCL. Note that if the translation failed, only the FME_Status and FME_FailureMessage will hold any values.

Global Variable

Contents

FME_CPUTime

The total CPU time from just before the FME_BEGIN_TCL was called until just before the FME_END_TCL was called.

FME_CPUUserTime

The amount of user CPU time used from just before the FME_BEGIN_TCL was called until just before the FME_END_TCL was called.

 

FME_CPUSysTime

The amount of system CPU time used from just before the FME_BEGIN_TCL was called until just before the FME_END_TCL was called.

 

FME_ElapsedRunTime

The actual elapsed time used from just before the FME_BEGIN_TCL was called until just before the FME_END_TCL was called.

FME_ElapsedTime

The elapsed time from just before the FME_BEGIN_TCL script was called until just before the FME_END_TCL was called.

FME_EndingSeconds

The seconds since epoch when the translation ended (as returned by [clock seconds])

FME_EndingTimeStamp

The ending time of the translation, formatted as YYYY-MM-DD HH:MM:SS

FME_FailureMessage

The failure message if the translation failed, blank if the translation succeeded

FME_FeaturesRead(<featureType>)

Each element in this array, indexed by feature type, holds the number of features read for that feature type.

FME_FeaturesWritten(<featureType>)

Each element in this array, indexed by feature type, holds the number of features written for that feature type.

FME_Licensing (FME 2013+) The edition information and FME license type.

FME_LogFileName

Allows you to write custom (user-defined) messages to the log file. For example:

FME_END_TCL set outputFile [open $FME_LogFileName a] ; \

puts $outputFile {}; \

puts $outputFile {Writing some stuff at the end}; \

\

close $outputFile;

FME_MacroValues(<macroname>)

Each element in this array, indexed by macro name, holds the number of each macro known to the workspace or mapping file at the end of parsing.

FME_MappingFileId

The value of MAPPING_FILE_ID keyword if specified in the mapping file.

FME_MemoryUsage (FME 2013+) The amount of memory being used at the end of the translation.

FME_NumFeaturesLogged

This variable records the total number of requests for features to be logged. This can be helpful to detect features that a writer may have rejected.

Note that to avoid accumulating hundreds of features in the log, FME by default suppresses all log attempts after the first 20. Therefore, the actual number of features logged may be fewer than the number requested.

FME_PeakMemoryUsage (FME 2013+)

The maximum amount of memory that was used at any point during the translation.

FME_StartingSeconds

The seconds since epoch when the translation was started (as returned by [clock seconds])

FME_StartingTimeStamp

The starting time of the translation, formatted as YYYY-MM-DD HH:MM:SS

FME_Status

0 if the translation failed and 1 if it was successful

FME_TotalCoordinates

The total number of coordinates output

FME_TotalFeaturesRead

The total number of features read

FME_TotalFeaturesWritten

The total number of features written