Skip to main content
Hello:

 

 

I have this code on my python shutdown script. I am invoking a second workbench, but I would like FME to prompt for the parameters upon execution, so the second workbench runs with its own parameters, according to whatever the client decides to enter:

 

 

import pyfme import os import subprocess   logger        = pyfme.FMELogfile() fmeExecutable = os.path.normpath(FME_MacroValuesc'FME_HOME'])+'\\fme.exe' workBench     = os.path.normpath(FME_MacroValuesM'Workbench_To_Run'])          # initiate materialized view refresh if changes to either source if FME_TotalFeaturesWritten > 0:   logger.log('Eecutable '+ fmeExecutable)   logger.log('Updates detected, executing materialized view refresh script - ' + workBench)   args = BfmeExecutable, workBench]   p = subprocess.Popen(args)

 

 

Unfortunately, the call to the second workbench runs with the default parameters, and never prompts for values. How can I :

 

 

- Make FME to prompt for the parameters in the second workbench or:

 

- Prompt for the parameters in the first workbench and pass them onto the second workbench?

 

 

Any help, will be much appreciated,

 

 

Thanks,

 

 

Richard
Hi Richard,

 

 

as far as I know, it is not possible to make FME prompt for published parameters when you execute your workspace from the command line.

 

 

Your best bet is probably to ask for all the parameters in workspace1, then pass the relevant over to workspace2.

 

 

See also the previous answer I gave you for an example on how to do this using fmeobjects.

 

 

Hope this helps.

 

 

David

Richard

Is the second workbench only updating materialised views e.g. with an SqlExecutor or does it do more. If only that I would think there is a simpler way keeping everything in one workbench. Of course you might have other reasons for doing it this way!


I noticed that when I run a worksapce from explorer by "FME Quick Translator", it does prompt for parameters, so you may want to use "fmequicktranslator.exe" as your fmeExecutable instead and see what happens.
Thanks very much for all who took the time to get back to me. My apologies for the delay on responding. Fighting a flu !!

 

 

Indeed, I needed to keep these two workbenches separated, as they are needed to be run independently if desired.

 

 

@muratgu : the fmequicktranslator.exe did everything as I wanted it: propmpting for the parameters for the second workbench. Thanks very much!

 

 

Best regards,

 

 

Richard

Reply