Skip to main content
Question

Dynamic writer based on FeatureReader

  • February 18, 2015
  • 5 replies
  • 15 views

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
Hi,

 

 

I'm reading in some data via the FeatureReader transformer and I would like to write it out dynamically, but when I try to setup the dynamic proprties I get a pop-up message No reader or schema reader found.  Please add a reader or schema reader to workspace that can be used as a schema source.

 

 

I can't add a reader or schema reader because the data does not exist prior to the workspace being run.  Any ideas?

5 replies

david_r
Celebrity
  • February 19, 2015
Hi,

 

 

can this be of help?

 

http://fmepedia.safe.com/articles/Samples_and_Demos/Dynamic-Workflow-Tutorial-Destination-Schema-is-Derived-from-List-Attributes

 

 

You might also want to know the FME 2015.1 will probably introduce the complementing FeatureWriter transformer, which might simplify this for you.

 

 

David

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • February 19, 2015
You could add a reader reading same table as your featurereader, read just 1st line or so, either sampling but better to set it in the navigator panel.

 

That way you have a schema availabel for your writer.

 

 

You could even add a parameter and link it to the featurereader parameter (this is done in the navigator). Then you could use this parameter in your reader.

david_r
Celebrity
  • February 19, 2015
To expand on my post above:
  • FeatureReader followed by a SchemaSetter (https://store.safe.com/transformers/SchemaSetter.htm), make sure to exclude prefixes (such as "fme_" etc that you don't want to write)
  • Insert at NULL reader somewhere in your workspace, this just serves as a dummy to "distract" the workbench dialogs
  • On your output feature type, select Dynamic schema and point it to the NULL (dummy) reader.
The "magic" list created by the SchemaSetter containing the schema from the FeatureReader will now be used to define your output features.

 

 

David

david_r
Celebrity
  • February 19, 2015
Forgot the screendump:

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • February 19, 2015
The null reader was the piece I was missing.  Thank you David.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings