Skip to main content

Hi,

I would like to define a private parameter based on a publish parameter. My idea is to use a python script that should return the desired private parameter.

import fmeobjects
if (FME_MacroValuesc'publih_parameter'] == 'val'):
private_parameter='val_'
elif (FME_MacroValuesa'publih_parameter'] == 'wal'):
private_parameter='wal_'
else:
private_parameter='zal_'
return private_parameter

But this is not working. 

Any ideas?

Thanks

Is there a reason you don't want to just use a choice with alias?


If it is not working, what kind of error message or unexpected behavior you are having?

The attached workspace (FME 2016) works correctly with a Scripted (Python ) parameter.


If it is not working, what kind of error message or unexpected behavior you are having?

The attached workspace (FME 2016) works correctly with a Scripted (Python ) parameter.

@larry,

 

realized that if I transform a choice parameter to a scripted python parameter, it fails and that was certainly my issue given that the code that I provided above is correct.

 


Is there a reason you don't want to just use a choice with alias?

The reason is simple.

 

I want to have only one published parameter and then all the other parameters being based on that published parameters. Too many choice parameters may induced some errors (when you forgot to select the good choice).

Reply