Skip to main content
Solved

How to define a parameter using another parameter?


arthy
Contributor
Forum|alt.badge.img+8
  • Contributor

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_MacroValues['publih_parameter'] == 'val'):
	private_parameter='val_'
elif (FME_MacroValues['publih_parameter'] == 'wal'):
	private_parameter='wal_'
else:
	private_parameter='zal_'
return private_parameter

But this is not working. 

Any ideas?

Thanks

Best answer by larry

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.

View original
Did this help you find an answer to your question?

4 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • July 10, 2017

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


Forum|alt.badge.img
  • Best Answer
  • July 10, 2017

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.


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • July 11, 2017
larry wrote:

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.

 


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • July 11, 2017
ebygomm wrote:

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).

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings