Question

Attribute list parameter in featureMerger


Is there a way to use an Attribute List parameter when specifying parameters to join on in a featureMerger? I am creating a custom transformer that uses a featureMerger, and I am trying to make it possible to select a variable amount of attributes as a parameter that would also be used for the merging. I have both tried to find a way to use it directly in the featureMerger and tried to split the list into multiple attributes, but without success.

I would assume that allowing a variable amount of attribute names as a parameter in a custom transformer would be a common usecase, so it seems a bit strange to not be able to use them in a featureMerger.


4 replies

Userlevel 4
Badge +30

Hi @simen, did you set the list attributes inside the transformer FEatureMerger?

Thanks,

Danilo de Lima

Hi @simen, did you set the list attributes inside the transformer FEatureMerger?

Thanks,

Danilo de Lima

Sorry, but I am not trying to create an attribute that is a list in the featureMerger, but to use a parameter that is a list of attributes (attribute list) when setting attributes to join by. I am trying to do something like this (does not work, but hopefully illustrates what I am trying to accomplish):

 

Userlevel 2
Badge +17

Hi @simen, the value of Attribute List (space delimited) type user parameter is a single character string consisting of specified attribute NAMES delimited by spaces. Since $(attributes) (i.e. parameter value) is a fixed string, the FeatureMerger in your screenshot performs unconditional merging always.

A possible solution I can think of is to concatenate the VALUES of specified attributes using a Tcl script to make a single attribute which can be set to the Join On parameter in the FeatureMerger.

See the attached example workspace: attribute-list-parameter-example.fmw (FME 2016.1.3+)

Hope this helps.

 

Hi @simen, the value of Attribute List (space delimited) type user parameter is a single character string consisting of specified attribute NAMES delimited by spaces. Since $(attributes) (i.e. parameter value) is a fixed string, the FeatureMerger in your screenshot performs unconditional merging always.

A possible solution I can think of is to concatenate the VALUES of specified attributes using a Tcl script to make a single attribute which can be set to the Join On parameter in the FeatureMerger.

See the attached example workspace: attribute-list-parameter-example.fmw (FME 2016.1.3+)

Hope this helps.

 

Thanks, that workaround does exactly what I was looking for. Hopefully FME makes working with attribute lists easier to work with in future versions though.

 

Reply