Question

Dynamic workflow using schema lookup table


Hopefully not too obvious an answer, but I've been wading through FME documentation all day to try and figure this one out.

Essentially I want to build a dynamic workflow that I can point to a series of GeoJsons that:

  • Will have similar, but differing schemas
  • Many will share attribute fields, but not universally
  • Will be consistently named

I want to then write to an SDE, initially as a new table but from then on only as an update. These output SDE FeatureClasses:

  • Will require additional fields that again are not universal
  • Will vary in geometry type, but only between FC, not within a FC

I'd like to be able to design a workflow that will be able to generate the output FC schema based on the input, and picture that this should be achievable by using a lookup table something like the following:

1FCA, FCBInput attribute fieldDestination attribute field2FCA, FCC, FCDInput attribute fieldDestination attribute field3FCB, FCDInput attribute fieldDestination attribute field4FCA

 

Destination attribute field5FCB, FCC

 

Destination attribute field

 

So the model would only need to manage one GeoJson at a time, but should be able to identify that if the GeoJson is FCA, it requires attribute fields 1 & 2 to be mapped to destination attribute fields 1 & 2 and to create destination attribute field 4. I'm unsure whether this needs to be done using a lookup table, a series of schema features, or something else.

I'm new to FME but not to a lot of the process concepts so if anyone can point me to any documentation of similar exercises which may get me on the right track I'd appreciate it.


2 replies

Badge +6

Hello @r.houg,

It sounds like you need a conditional Schema Mapping for the bulk of the work. Using a spreadsheet you can define the Source/Target Schemas with how you want the mapping to occur.

 

 

We have some tutorials that should help give you an idea of what this would look like:

 

https://knowledge.safe.com/articles/1043/conditional-feature-type-mapping-schemamapper.html

 

https://knowledge.safe.com/articles/1160/advanced-schema-mapping-schemamapper.html

 

 

I think the above articles will be enough to get you started with the Schema-mapping. The second portion of the workflow would involve the Dynamic writing. I think this tutorial will be able to help narrow down the precise nature of the workflow you are looking for.

 

 

https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html

 

 

I hope that helps get you started. If you run into difficulties just reply here and we can try assist!

Hello @r.houg,

It sounds like you need a conditional Schema Mapping for the bulk of the work. Using a spreadsheet you can define the Source/Target Schemas with how you want the mapping to occur.

 

 

We have some tutorials that should help give you an idea of what this would look like:

 

https://knowledge.safe.com/articles/1043/conditional-feature-type-mapping-schemamapper.html

 

https://knowledge.safe.com/articles/1160/advanced-schema-mapping-schemamapper.html

 

 

I think the above articles will be enough to get you started with the Schema-mapping. The second portion of the workflow would involve the Dynamic writing. I think this tutorial will be able to help narrow down the precise nature of the workflow you are looking for.

 

 

https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html

 

 

I hope that helps get you started. If you run into difficulties just reply here and we can try assist!

Thanks Trent,

I've put this on hold for the time being but the links you provided look like they should do the trick. I'll review and accept the answer once I've had a chance to revisit the original workflow.

Reply