Skip to main content

I'm trying to set up a parameter for the output file path for a geodatabase writer, but having problems with using the "Choice with Alias parameter" type.

When I try to set up something like this:

 

Value: \\\\server\\sharename\\examplefolder\\Output.gdb

 

Display Name: Testing

 

 

When it comes to runtime the path of the geodatabase is passed to the writer like this...

 

<backslash><backslash>server<backslash>sharename<backslash>examplefolder<backslash>Output.gdb

 

 

...which causes the translation to fail.

Using a 'Choice' parameter for the path works fine but using an alias would be helpful for this particular job.  From this FME Evangellist article here it seems like this should work but perhaps I'm missing something.

 

 

Using FME 2012 SP3

 

 

Thanks.

 

Hi,

 

 

you can use a TextDecoder with "XML" as the encoding type, this will convert it back into a regular path string.

 

 

David
Hi,

 

 

In my simple testing with a ParameterFetcher transformer, <backslash> was translated to \\ automatically in the workflow. The error occurred when I linked the destination directory parameter of the writer to the Chice with Alias parameter. And after replacing <backslash> with \\ manually in 'Configuration' text box of 'Add/Edit Parameter' dialog box, it worked (FME 2013 SP1). I think this is a matter which should be improved for the future FME version.

 

 

Takashi
Thanks for the responses.

 

 

David:

 

I'd prefer to stay away from grabbing/setting the output path parameter with an in-line transformer as in some jobs I have a large number of feature types in the writer.  I also did a quick test and it looks like the TextDecoder isn't required when grabbing the output path parameter in-line as it appears correctly without the <tags>.

 

 

Takashi:

 

I did try replacing the <backslash> in the configuration field after I posted, but while that did resolve the issue when run from workbench, it still reverts back to passing the path with the punctuation tags when run as a server job.

 

 

Seems like there is something strange going on with how FME stores and retrieves paths with this parameter type.

 

 


Hi, I am facing the same issue when running as server job. I am FME server 2015. Thank you.


Hi, I am facing the same issue when running as server job. I am FME server 2015. Thank you.

If nothing of the above helps, you can convert the value using a PythonCaller and something like this:

myPath = FME_MacroValues<'MY_PUBLISHED_PATH_PARAMETER']
fixedPath = fmeobjects.FMESession().decodeFromFMEParsableText(myPath)
feature.setAttribute('FIXED_PATH', fixedPath)

You can then access the new attribute FIXED_PATH in your workspace.

David


Unfortunately this is a known issue that isn't fixed yet. It's filed in our system as PR#66571 (so if anyone else experiences this, please contact support and mention that reference number).

I will report your case and increase the priority so we can get a fix more quickly.

Other than that, I don't know of a workaround, other than to try David's Python fix. Sorry.


Thanks for the useful background and solutions to this problem. I have just encountered this for myself in FME Desktop and Server 2017.1 and hence stumbled across this post!

For what it's worth, here's a brief explanation of my problem and what I did to workaround the issue...

Problem:

 

I wanted to use a Choice with Alias parameter to offer a more friendly way of choosing which Seed File to use when writing to DGN. Instead of exposing the whole path of the Seed File to the user for them to select I just wanted to use a simple name that they would understand. Hence why my original approach led me here!

Workaround:

 

Fortunately, as my Seed Files all exist in the same folder, I just needed to create a Choice with Alias parameter that simply contained the Seed File filenames and a relevant friendly Alias for each. This parameter can then be appended to the folder location specified in the Seed File (v8 only) parameter of the DGN writer. The user then only gets to see the friendly name at runtime whilst the parameter sets the correct filename to be appended to the Seed File folder.

This workaround is obviously only really useful if the files you want to select are located in the same folder!

Hope this helps someone out there :-)

Simon


Reply