Begin/End Python

From fmepedia

Begin/End Python scripts, also known as Startup and Shutdown python scripts, allow users to run Python scripts before and after and FME translation. Prior to script execution, FME sets several useful variables.

Why would you want to do such a thing?

Startup and Shutdown scripts allow users to integrate fme into their organizations overall workflow. Via startup/shudown scripts, you can:

  • Copy data to local directory for processing
  • Copy the results of a successful translation to a network share, or an ftp site.
  • Email translation results (good or bad) to interested parties
  • Log overall statistics to a database, or common log file.

Available Variables

nametype
FME_MappingFileIdstring
FME_TotalFeaturesReadinteger
FME_FeaturesReaddictionary (featuretype->count)
FME_TotalFeaturesWritteninteger
FME_FeaturesWrittendictionary (featuretype->count)
FME_FailureMessagestring
FME_TotalCoordinatesinteger
FME_CPUTimefloat
FME_LogFileNamestring

Example

Workbench support for Startup and Shutdown scripts was recently added to the FME 2007 betas. For an example, see the Begin End Python Example.

User Comments Add a new comment