Question

Custom transformer dynamic attribute name

  • 14 November 2012
  • 5 replies
  • 3 views

Badge +22
  • Contributor
  • 1961 replies
What is the best way to specify the output attribute name on a custom transformer?  I can add a paramter , but the logical transformer (AttributeCreator) let's me link the value of an attribute easily enough, but not it's name.

5 replies

Badge +21
If I understand correctly you want to link an Attribute within a Customtransformer (for instance MyCustomTransformer) to an AttributeName?

 

 

Can the VariableSetter and VariableRetriever help you?
Badge +22
What I would like is to specify the new attribute name that the custom transformer will spit out.  

 

 

In this particular case the custom transformer takes an attribute with a coordinatate in the form of CDD(D)MMmSmSmSmS and returns decimal degrees.  

 

 

I would like to use it twice in the main workspace and specify the name of the attribute that will contain the decimal degree value.

 

 

I already have it working to select which attribute to process, now I just need the other half.
Badge +22
I know I can do the cleanup in the main workspace, but then I would have to pair the transformers everytime I used the custom transformer, which sort of defeats the purpose of wrapping all the functionality into one custom transformer.
Userlevel 4
Badge +26
Yes, use the AttributeRenamer.

 

 

1) create a text parameter to define the attribute name

 

2) create an attribute ("test" for example) with the correct value

 

3) In the attributeRenamer rename from test to $(aaa) where aaa is the name of the parameter created in step 1

 

 

Badge +22
Hi Mark,

 

 

That worked for FME 2012, but it is slightly broken in FME2013.  The transformer shows the parameter reference $(a) on the transformer instead of resolving it.  However the inspector shows the correct attribute when the workspace in run.

Reply