Skip to main content
Question

Attribute list parameter in featureMerger

  • July 11, 2017
  • 4 replies
  • 23 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • July 11, 2017

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

Thanks,

Danilo de Lima


  • Author
  • July 12, 2017

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):

 


takashi
Celebrity
  • July 12, 2017

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.

 


  • Author
  • July 12, 2017

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.