Skip to main content

Hello,

I have a configuration table that my FME workspace reads to update a GIS database. This table includes ArcSDE database connection information. The workspace dynamically reads each database connection one at a time and passes it to the Feature Reader. Because it's dynamic, all features are routed through the generic port.

Currently, I use an AttributeExposer to make feature attributes available for processing. However, this requires manual updates whenever database schemas change, which is problematic since the workspace runs on a schedule.

Is there a way to automatically expose attributes at runtime, based on the schema of the next database being read, so I can eliminate the need for manually updating the AttributeExposer?

 

Thank you,

 

Just use the schema feature from the FeatureReader, put that and the datafeatures in the same inputport in the FeatureWriter, check the dynamic box in the FeatureWriter and you’re good to go. No exposing needed. When input schema changes, output schema changes as well.


@nielsgerrits , the feature writer will write the data.. but I need to perform attribute mapping before writing it out. This is what i am feeding into feature reader ( one database at a time)

 

 


But how do you dynamically fix the mapping? How do you map a new attribute you don’t know yet, when it is not there when editing the workspace? If you don’t know that “attribute A“ will be there, you can’t assign it to a transformer. I know this is a difficult subject to understand, but when you are doing autonomous translations, you don’t need to expose attributes.


@nielsgerrits , The configuration table has attribute mapping values. For example, the database Fixville.sde has a Type_name attribute, and its value comes from the ABC attribute in our client data. I have all the information in the configuration table, and I want to read the table and perform updates to the database. i am stuck where i am reading databases and want to read the table name, and i can’t get the data without exposing attributes. I need to join this data with client data to do the attribute mapping


I’m sorry but I don’t think I understand what you are trying to do.


@nielsgerrits 

Thanks, I appreciate the clarification. Let me try to explain a bit more clearly what I’m trying to achieve.

My goal is to use the configuration table to drive both the database connections and the attribute mappings dynamically. Each record specifies which source database to read and which attributes map to which fields in the target schema.

The challenge is that when I read the source database dynamically, the FeatureReader sends everything through the generic port, so the schema isn’t exposed and I can’t easily join or map those attributes without manually exposing them first.

I’m trying to find a way to expose or handle those attributes automatically at runtime so I can perform the mapping before writing.

Does that make sense, or am I missing a more efficient approach to handle this dynamically?


I think the renaming of unexposed attributes can be done using a PythonCaller. Then a SchemaScanner to generate the SchemaFeature to dynamically write the data.

For joining… you could generate sql to join data, maybe run it via a SQLExecutor. This is also where the renaming can be done. This can also output the SchemaFeature. But have not tried this.

But still. If the source schema changes, you'll need to change something, now you'll need to change your configuration table.