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
| name | type |
|---|---|
| FME_MappingFileId | string |
| FME_TotalFeaturesRead | integer |
| FME_FeaturesRead | dictionary (featuretype->count) |
| FME_TotalFeaturesWritten | integer |
| FME_FeaturesWritten | dictionary (featuretype->count) |
| FME_FailureMessage | string |
| FME_TotalCoordinates | integer |
| FME_CPUTime | float |
| FME_LogFileName | string |
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.
