Solved
In TCL, '$FME_MappingFileId' is used to refer to MappingFileId. How to refer to MappingFileId in Python?
In TCL, '$FME_MappingFileId' is used to refer to MappingFileId. How to refer to MappingFileId in Python?
Best answer by takashi
Hi George,
View original
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
<strong>This post is closed to further activity.</strong><br />
It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br />
If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br />
If there is a genuine update to be made, please contact us and request that the post is reopened.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.