Question

Attribute Remover also affects User Parameter

  • 23 August 2019
  • 1 reply
  • 2 views

Badge

In workspace 1 (WS1) the "_dirPath" and "_outputName" is derived from the input and a timestamp. For example: 

Input: C:\Temp\MyFile.csv

Output: C:\Temp\MyFile_2019-8-22.csv

These values are then passed into a custom transformer (WS2) so that  _dirPath and _outputName show up as User Parameters.

This is done because :

Answer by takashi · Feb 14, 2018 at 02:56 PM
FME configures user parameters before starting the translation, and their values cannot be    changed in the workflow later. Source

In WS2 I have a Feature Writer that exports to csv. The Feature Readers Dataset is set to, $(_DIRPATH) ie. the user parameter that is set from "_dirpath" in WS1 and the CSV file name is set to $(_OUTPUTNAME).

Now, this all works fine.

 

The problem is I want the feature writer to have it's User Attributes set to "Automatic". Yet, at the same time I don't want the attributes of "_dirPath" and "_outputName" showing up in the output. While the user params of $(_DIRPATH) ,  $(_OUTPUTNAME) should be set at the start of the translation and cannot be changed. 

Yet, when I use an attribute remover on "_dirPath" and "_outputName" the feature writer stops working and gives the following error:

test3_FeatureWriter(WriterFactory): MULTI_WRITER: No dataset was specified for MULTI_WRITER_DATASET or test3_FeatureWriter_0_DATASET or CSV2_DATASET
MULTI_WRITER: No dataset was specified for MULTI_WRITER_DATASET or test3_FeatureWriter_0_DATASET or CSV2_DATASET

I'm at a loss to why this is happening... 

It is set with $(_DIRPATH) ,  $(_OUTPUTNAME) at the start of translation so how are the user param values also being affected?

If attribute remover is deleted it works again...


1 reply

Badge +3

@tforward

 

As you say you are removing "_dirPath" and "_outputName" i assume you used a parameterfetcher in WS2 to get to the parametervalues.

Might you have used those to drive the featurewriter?

 

 

 

Automatic kinda grabs all attributes in the stream the FeatureWriter is in, so in your case including those attributes. You could just filter them out of the stream, with a tester or stringsearcher.

 

Or maybe you are better of using "dynamic" rather then "automatic".

 

I'm sure the parameters themselves are not reset. (not possible afaik)

Reply