I have my parameter values in a SQLite table. I am able to access each value though a Python scripted parameter that opens the table and retrieves the value. However, this means that I have to open and close the SQL table one time for each parameter. Is there a way to make multiple parameters that can be read by the readers and transformers, perhaps in the Python startup script?
Solved
Create Multiple Parameters in Scripted Python Parameters
Best answer by takashi
Hack. You can define the dictionary as a global variable which can be accessed while FME is configuring user parameters. e.g.
First scripted (Python) parameter:
global a
a = {'ap':'apple','ba':'banana','ch':'cherry'}
return a['ap']
Second scripted (Python) parameter:
return a['ba']
Third scripted (Python) parameter:
return a['ch']
Note: A global variable defined in a scripted (Python) parameter can be used only in scripted (Python) parameters. It cannot be used in the Startup/Shutdown Python script, PythonCreator, and PythonCaller in the workspace.
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.