In TCL, '$FME_MappingFileId' is used to refer to MappingFileId. How to refer to MappingFileId in Python?
Page 1 / 1
Hi George,
I was able to get the Mapping File ID with this script.
It's not described in official documentations. There might be simpler way.
-----
# Startup Python Script Example: Get Mapping File ID
import fmeobjects
# Get Mapping File ID via FMESession object.
# Mapping File ID will be returned as a list of strings (words).
session = fmeobjects.FMESession()
mappingFileId = ' '.join(session.getSettings('MAPPING_FILE_ID'))
session = None
# Log the Mapping File ID. (test)
logger = fmeobjects.FMELogFile()
logger.logMessageString(mappingFileId, fmeobjects.FME_WARN)
logger = None
-----
A global FME object should be released explicitly by assigning None to prevent this warning.
"Warning: not all FMESessions that were created were destroyed before shutdown. This may cause instability"
But it seems not to be essential in FME 2014. Maybe improved? (not confirmed)
Takashi