Skip to main content
Question

Custom transformer setting value for passed attribute

  • 31 January 2013
  • 6 replies
  • 55 views

Prior to FME 2012 I have created custom transformers that have a published parameter of an attribute name that is passed to the custom transformer. If I wanted to set the value of the attribute passed as a parameter I used the AttributeSetter transformer with the Attribute set to the published parameter containing the attribute name.

 

 

How do I accomplish this in FME 2012 given the AttributeSetter has been replaced with the AttributeCreator? I tried manually typing in the parameter name into AttributeCreator  Attribute Name field but no luck. I feel like I am missing something obvious and hopefully some one can fill me in.

 

 

Thanks,

 

 

CA
It's a sneaky hidden bit of the UI that doesn't make life easy for you!

 

 

Click the row in the AttributeCreator in the 'Value' column. Try a double click if you don't see anything change. An elipsys button and a drop down button appear to the right, click the drop down and choose "Link to Parameter".
Thanks for the response.

 

 

I didn't explain it very well because I am trying to set the value of the attribute passed as a parameter not set an attribute to the value of passed parameter.

 

 

Example:

 

 

Custom transformer has published parameter: Parm_Column_Name.

 

 

The custom transformer is called with the attribute ColumnA passed as the parameter Parm_Column_Name.

 

 

Within the custom transformer I want to set the value of ColumnA. As I mentioned earlier I previously have done this using the AttributeSetter.

 

 

I hope that makes it clearer.

 

 

C
Not quite sure I'm understanding correctly, but if you just want to recreate what the attribute setter does in the attributecreator you double click in the attribute name field and then you'll get a drop down with the list of attributes that already exist.
I am trying to do this in a custom transformer where the attribute to be set is passed to the custom transformer which means it can be a different attribute everytime the transformer is called.

 

 

I could use a PythonCaller and use the setAttribute function but previously I was able to use an AttributeSetter since I could point the attrbute name to be set to a parameter. This is not possible with an AttributeCreator from what I can see.

 

 

C
Will this post help you?

 

 

https://safe.secure.force.com/AnswersQuestionDetail?id=906a0000000ci2pAAA

 


Not sure if I have read this write but I assume you want to use the parameterfetcher within the custom transformer.

 

 

i.e. You hve a public parameter in you custom transformer and you want to find what that attribute is?

Reply