Managing Attributes
A high proportion of the top 25 transformers are support transformers for managing attributes. These create new attributes, rename them, set values, and delete them.
A key use for these transformers is to rename attributes for the purpose of schema mapping.
Attribute Managing Transformers
The key attribute-management tasks and the transformers that can be used are as follows:
Task | Transformers |
---|---|
Create Attributes | AttributeCreator, AttributeManager |
Set Attribute Values | AttributeCopier, AttributeCreator, AttributeManager, AttributeRenamer |
Remove Attributes | AttributeKeeper, AttributeManager, AttributeRemover, BulkAttributeRemover |
Rename Attributes | AttributeManager, AttributeRenamer, BulkAttributeRenamer |
Copy Attributes | AttributeCopier, AttributeCreator, AttributeManager |
Sort Attributes | AttributeManager |
Change Attribute Case | BulkAttributeRenamer |
Add Prefixes/Suffixes | BulkAttributeRenamer |
Many of these transformers can carry out similar operations, and you can see that the AttributeManager does so many tasks you can use it almost exclusively.
WARNING |
Don't misunderstand the BulkAttributeRenamer. It changes the case - or adds suffixes/prefixes - to the attribute name, not the attribute value. |
Lists
A List in FME is a mechanism that allows multiple values per attribute. So, where the attribute myAttribute can only contain a single value, the list attribute myList{}.myAttribute can contain multiple values as:
myList{0}.myAttribute myList{1}.myAttribute myList{2}.myAttribute
For example, a single polygon representing a forested area, might have a list attribute to record the tree species contained in that area:
TreeList{0}.Species = Oak TreeList{1}.Species = Chestnut TreeList{2}.Species = Ash
Various transformers can create lists, others include support for lists, and several are designed to operate specifically on list attributes (for example the ListSorter).
For further reading check out this article on Attribute Management on the Safe Software blog.