Skip to main content
Solved

How can I manage the order of writers?

  • May 10, 2017
  • 1 reply
  • 85 views

I've looked at a couple of similarly named questions and they're not quite what I'm after.

I have a work space with many Mapinfo Tables being written to many GML feature types into a single output GML file. 

I'm getting varying orders of output. For example I have a GML Feature called "Header". I'd like that written first. Is there a way to prioritise the execution?

In addition I have two GML Features that use the same MI table as a source. Oddly or perhaps obviously, the output order is "woven" together.

eg

GML Feature 1
GML Feature 1
GML Feature 1
GML Feature 2
GML Feature 1
GML Feature 1
GML Feature 2
GML Feature 1
GML Feature 2

While I know write order is inconsequential in XML\GML there is a process where somebody eyeballs the Header in a text editor to make sure the content is correct. Looking for the header buried in the files just adds time.

Any advice appreciated.

Best answer by takashi

Hi @andyew, if you are using one or more blocking transformer (sometimes called group-based transformer) in the workflow, the order of features written may be different from the order of features read.

To control the order, a possible way is, add an attribute storing a number that represents your desired order to every feature, and sort the features with the Sorter by the number before writing. For example, give 0 to the "Header" feature; give 1 or greater to other features with the Counter. You can then sort them to guarantee that the "Header" will always be written at first.

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.

1 reply

takashi
Celebrity
  • Best Answer
  • May 10, 2017

Hi @andyew, if you are using one or more blocking transformer (sometimes called group-based transformer) in the workflow, the order of features written may be different from the order of features read.

To control the order, a possible way is, add an attribute storing a number that represents your desired order to every feature, and sort the features with the Sorter by the number before writing. For example, give 0 to the "Header" feature; give 1 or greater to other features with the Counter. You can then sort them to guarantee that the "Header" will always be written at first.