Skip to main content

Hi,

I have a workspace with two creators which I use to create a single constant text line each. The rest of the workflow reads data and creates text lines depending on the content of the data (10 lines in this example). Now I want to write the text line of the first creator first to a text file, then the lines generated dependent on the data and the text line from creator_2 last. As Creator_2 is much faster then reading all the data in between, in the resulting text file I get the text line from Creator_1 first, then the line from Creator_2 and the lines from the data last. Is there a way to control that the line created by Creator_2 is written last?

So far I can only see that the Creator order can be controlled...

thanks,

Ludwig

Maybe you can combine a FeatureHolder, and a Sorter to make sure the features arrive in the right order to the Writer.


Maybe you can combine a FeatureHolder, and a Sorter to make sure the features arrive in the right order to the Writer.

Great suggestion @thomas_merkus

 


On the feature coming out of the first Creator, use your AttributeManager_1 to create an attribute of 'sort_att' with a value of 1. Use a Counter on the content data, with Count Output Attribute set to 'sort_att', and Count Start set to 2. On the last feature, use your AttributeManager_6 to create an attribute of 'sort_att' with a value of 9999 (just a number bigger than the number of content data features). Then feed all features into a Sorter prior to output, sorting Numerically and Ascending based on the attribute 'sort_att'.


If there is no blocking transformer on the data flow from the reader (10 text lines), you can just set "Yes" to the Create At End parameter in the Creator_2.


On the feature coming out of the first Creator, use your AttributeManager_1 to create an attribute of 'sort_att' with a value of 1. Use a Counter on the content data, with Count Output Attribute set to 'sort_att', and Count Start set to 2. On the last feature, use your AttributeManager_6 to create an attribute of 'sort_att' with a value of 9999 (just a number bigger than the number of content data features). Then feed all features into a Sorter prior to output, sorting Numerically and Ascending based on the attribute 'sort_att'.

@cartoscro: That's it. Very useful easy transformers. I am a FME noob, but start to love it more and more!

 


Reply