Skip to main content
Solved

Modifying format attributes in dynamic writer

  • July 27, 2018
  • 2 replies
  • 71 views

aurelienchaumet

Hi,

on a project, i'm using a FeatureReader to call different shapefiles, localized in different folders.

The purpose is modifying shapefile names to normalize them throw AttributeManager, one for the Schema outpout port and another one for th Generic.

 

Until here, everythnig works.

By the way, i'm trying to modify the attributes format which are being created by the writer, for instance varchar(254) -> varchar(5).

 

With dynamic mode, i guess i have to modify the schema values with some ListExploder -> AttributeManager -> ListBuilder.

Once these operations are done, the new schema has exactly the same attributes name and lists than the original schema, but the dynamic shapefiles aren't writen..

Is there something i'm doing wrong??

Thanks for helping!!!

Best answer by takashi

Hi @aurelienchaumet, I suppose that you are going to configure dynamic writer using a schema feature read by a FeatureReader as schema source.

The schema feature should arrive in the writer feature type before any data feature. It's guaranteed that the FeatureReader outputs schema feature first, but since the ListBuilder is a blocking-transformer, possibly the re-built schema feature would not arrive before data features.

Workarounds are:

  1. Modify the schema definition ("attribute{}" list) with PythonCaller not to block the feature.
  2. Or, merge the modified schema definition to every data feature. In this case, you should remove the "fme_schema_handling" attribute from the schema feature.

Please vote up this Idea :-)

Introduce New Transformer to Modify Schema Easily

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7842 replies
  • Best Answer
  • July 27, 2018

Hi @aurelienchaumet, I suppose that you are going to configure dynamic writer using a schema feature read by a FeatureReader as schema source.

The schema feature should arrive in the writer feature type before any data feature. It's guaranteed that the FeatureReader outputs schema feature first, but since the ListBuilder is a blocking-transformer, possibly the re-built schema feature would not arrive before data features.

Workarounds are:

  1. Modify the schema definition ("attribute{}" list) with PythonCaller not to block the feature.
  2. Or, merge the modified schema definition to every data feature. In this case, you should remove the "fme_schema_handling" attribute from the schema feature.

Please vote up this Idea :-)

Introduce New Transformer to Modify Schema Easily


aurelienchaumet

Thanks @takashi, I finally used ListElementSetter which call some python code... without having some code to write :D and it works !!

Thank you for taking time to answer and for the explanation !!!