If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.
If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.
Thanks ! Too bad it's a manual input but it works !
Â
Â
Thanks ! Too bad it's a manual input but it works !
Â
Â
That is simply how FME works.
Â
If you are interested, we have worked out a way to automatically expose all attributes linked to a feature in python. I could always send you this custom transformer.
If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.
Oh yes I'm interested. Even if it's just to look at the script, that would be useful !
Â
Can you post it here, or do you need my email adress ?
Â
Oh yes I'm interested. Even if it's just to look at the script, that would be useful !
Â
Can you post it here, or do you need my email adress ?Â
Â
I know remember that it is only possible to get all attributes and values as a list of pairs of attributes and attribute values. Since you do not know the names of all the attributes, you cannot add them dynamically in you PythonCaller transformer.Â
Â
Â
The code for that would be something like:
Â
 def getAllAttributes(feature):
attrList = ]
attrNames = sorted(feature.getAllAttributeNames()) index = 0 for attr in attrNames: index += 1 value = feature.getAttribute(attr) feature.setAttribute('attrList{index}.name', attr) feature.setAttribute('attrList{index}.value', value)Â
Â