Skip to main content

Hi everyone

 

I have an issue with Scripted Parameters inside of Custom Transformers (CT). More specifically, I have a published parameter in a workspace that receives the path to an SDE connection file. This parameter is linked to a CT attribute. Inside of the CT, a published parameter receives this path. Then, several private scripted (Python) parameters read credentials from a configuration table based on this sde path. The credentials are then used in a PythonCaller in the CT.

However, the content of the original Sde-parameter from the workspace cannot be used in the scripted parameters of the CT. Instead of its content, only the name of the parameter ("$(Sde)") is there. But when I hard code the path into the corresponding parameter of the CT in the workspace (instead of linking it to the published parameter), it works.

Do you have any idea how to fix this or to get a functioning workaround? To illustrate the problem, I attached a simplified example of my issue. I tested the bahaviour in FME 2016.1 and FME 2017.1.

Greetings,

 

André

@andr_As workaround, you could use the ParameterFetcher to obtain the parameter and store it as an attribute.


Hi Thomas

Thanks for the answer! The Workaround with a ParameterFetcher to send the parameter as an attribute value to the CT worked. By using a Sampler, a single feature now initiates a PythonCaller that contains the logic to read the credentials from the DB table.

I also tried to hard code the value for the published Parameter of the CT and use multiple copies of it together with a TestFilter. However, it turned out that the qualified name of the parameter inside the CT (<CT-Name>_<ParameterName>) belongs to its instance name. Thus, this workaround worked only for the CT-copy that had the original name.

Does anyone know a logical explanation why using published Parameters in combination with scripted parameters inside a CT cannot work? Or might it be just a bug?


Hi Thomas,

 

Thanks for the answer! I tried the ParameterFetcher to send the parameter value as an attribute to the CT and sampled a single feature to initiate a PythonCaller that reads the credentials from the DB table - it worked!

I also tried another workaround where the possible values for the SDE parameter were hard coded into the published parameter of the CT. Thus, several copies of the CT existed and were selected through a TestFilter evaluating the SDE parameter value. However, as the qualified name of the parameter used for the scripted parameters inside the CT (<CT-Name>_<Parameter-Name>) refers to the CT instance name, this solution only worked for the CT copy bearing the original name.

Is there a logical explanation why using a published parameter inside a scripted parameter of a CT cannot work? Or might it be just a bug?

Greetings,

 

André


maybe the scripted parameter use the FMEMacrovalue rather then the $?


Reply