Question

Conditional database connection parameter

  • 14 October 2022
  • 2 replies
  • 2 views

Badge +8

Hello,

I have a number of Workspaces that are run by colleagues using FME Server. These typically connect to a database, do some stuff, and create file-based output. The can run on three different environments, and because of that the database but also the output directory should be different. Right now I allow for that by using a database connection parameter and an output path parameter. It is to easy though to set one and forget the other, so that Production output ends up in a Test directory (or the other way around).

 

Is it somehow possible to have a single Choice-Parameter, that influences which database connection is selected in the database connection parameter? I know I can use the ${} notation, but that does not see to work for a database connection.


2 replies

Userlevel 6
Badge +32

I just tried in FME 2022.1 with a FeatureReader and a parameter value for the connection and it does work for me. What did you try and how?

 

In our workspaces we let scripted parameters manage the variables based on engine name. When engine name is empty it will use what you set manually. This way we can develop and push to server test then to server prod without having to worry about these things. This can also be done using external config files but this way it is packed together.

Badge +8

I just tried in FME 2022.1 with a FeatureReader and a parameter value for the connection and it does work for me. What did you try and how?

 

In our workspaces we let scripted parameters manage the variables based on engine name. When engine name is empty it will use what you set manually. This way we can develop and push to server test then to server prod without having to worry about these things. This can also be done using external config files but this way it is packed together.

A FeatureReader won't work for me, because I use much more than just a where-clause to select data from my databases. If it's just a simple select from a single table, then yes, I could make that work - but that's not the case. So then I'd need to replicate what sometimes is quite complicated SQL queries using transformers...

Reply