Is it better practice to useÂ
Â
import fme
param = fme.macroValuesa‘parameterName’]
or
import fmeobjects
param = FME_MacroValues‘parameterName’]
in Python scripted parameters and why?
Is it better practice to useÂ
Â
import fme
param = fme.macroValuesa‘parameterName’]
or
import fmeobjects
param = FME_MacroValues‘parameterName’]
in Python scripted parameters and why?
I've noticed that since FME 2018 I've been getting sporadical errors when importing fmeobjects in startup and shutdown scripts on FME Server. My guess is that this is somehow related to how the server engines seem to share session objects between jobs.
So recently I've adopted the following rule, which seems to work for all my use cases.
Startup/shutdown scripts + scripted parameters
import fme
param = fme.macroValuesm‘parameterName’]
PythonCaller / PythonCreator
import fmeobjects
param = FME_MacroValuesn‘parameterName’]
It would be great if someone from Safe could chime in with the official best-practices.
I've noticed that since FME 2018 I've been getting sporadical errors when importing fmeobjects in startup and shutdown scripts on FME Server. My guess is that this is somehow related to how the server engines seem to share session objects between jobs.
So recently I've adopted the following rule, which seems to work for all my use cases.
Startup/shutdown scripts + scripted parameters
import fme
param = fme.macroValuesm‘parameterName’]
PythonCaller / PythonCreator
import fmeobjects
param = FME_MacroValuesn‘parameterName’]
It would be great if someone from Safe could chime in with the official best-practices.
Â
Â
Â
Â
Â
Hopefully Safe can give us the official explanation here.Â
Hi @jdh,
FME_MacroValues is still available for backwards compatibility, but we would recommend that fme.macroValues be used instead.
Hi @jdh,
FME_MacroValues is still available for backwards compatibility, but we would recommend that fme.macroValues be used instead.
Â
Â
Hi @jdh,
FME_MacroValues is still available for backwards compatibility, but we would recommend that fme.macroValues be used instead.
Â
Â
Â
Thanks for catching that. I have created a problem report to have that changed to fme.macroValues instead.Â
Â
Thanks for catching that. I have created a problem report to have that changed to fme.macroValues instead.Â
Â
Â
I've noticed that since FME 2018 I've been getting sporadical errors when importing fmeobjects in startup and shutdown scripts on FME Server. My guess is that this is somehow related to how the server engines seem to share session objects between jobs.
So recently I've adopted the following rule, which seems to work for all my use cases.
Startup/shutdown scripts + scripted parameters
import fme
param = fme.macroValuesm‘parameterName’]
PythonCaller / PythonCreator
import fmeobjects
param = FME_MacroValuesn‘parameterName’]
It would be great if someone from Safe could chime in with the official best-practices.
Â
Â
Remember, though, I'm an old school Tcl guy and Python wannabee-pretender.Â
Â
I've noticed that since FME 2018 I've been getting sporadical errors when importing fmeobjects in startup and shutdown scripts on FME Server. My guess is that this is somehow related to how the server engines seem to share session objects between jobs.
So recently I've adopted the following rule, which seems to work for all my use cases.
Startup/shutdown scripts + scripted parameters
import fme
param = fme.macroValuesm‘parameterName’]
PythonCaller / PythonCreator
import fmeobjects
param = FME_MacroValuesn‘parameterName’]
It would be great if someone from Safe could chime in with the official best-practices.
Â
Â
Hi @jdh,
FME_MacroValues is still available for backwards compatibility, but we would recommend that fme.macroValues be used instead.
I'm still seeing the legacy behavior in 2019, at least in Data Interoperability.
i.e. FME_MacroValues
Hi @jdh,
FME_MacroValues is still available for backwards compatibility, but we would recommend that fme.macroValues be used instead.
Still not fixed in 2020.0
As I worked to resolve errors with attempting to reference a User Parameter from within a Python Scripted User Parameter, I discovered this thread. (Thank you, FME Community!)
When I double-clicked on a user parameter (‘DAYS_PRIOR’) in version 2023.2.1 (build 23774) within the Python Scripted​ Configuration interface, FME Form inserted: FME_MacroValuesa'DAYS_PRIOR']
In order to get the scripted parameter to function properly, I ended up changing the call to: fme.macroValuese'DAYS_PRIOR']
I also had to explicitly import the fme library.