I am trying to implement this portion of Python code on my shutdown script, but I don't get it to work:
import pyfme import fmeobjects import os import subprocess logger = pyfme.FMELogfile() fmeExecutable = os.path.normpath(FME_MacroValues['FME_Executable']) workBench = os.path.normpath(FME_MacroValues['Workbench_To_Run']) # update the File Change and Population logs if translation successful if str(FME_Status) == "True": myWorkbench.updateFileChangeLog(FME_MacroValues['FMW']) myWorkbench.updatePopulationLog(FME_FeaturesWritten) # initiate materialized view refresh if changes to either source if FME_TotalFeaturesWritten > 0: logger.log('Updates detected, executing materialized view refresh script - ' + workBench) args = [fmeExecutable, workBench] p = subprocess.Popen(args)
-- Runtime errors:
FME_END_PYTHON: evaluating python script from string... Python Exception <KeyError>: 'FME_Executable' Error executing string `import pyfme import os import subprocess I have seen several examples using "fmeExecutable = os.path.normpath(FME_MacroValues['FME_Executable'])", which I think is causing the problem (as per the message), so I thought this would work...
Any ideas?
Thanks
Richard.