Skip to main content

I want to write a different json file for every time window defined in my TimeWindower.

To make things simple I'm using the window number as the window ID attribute (when I manage to make it work like this I'll use the window start time).

I want to write the data in each time window into a different (json) file and to name them I want to use the window id attribute together with some other string.

Right now the first file (string_0) is output as expected but the workspace will only output 2 json files for a total of 4 time windows (I used a terminator after the 4th time window) and the second one is not properly closed.

Any idea of what am I doing wrong?

Hi @dms2​,

 

Just wanted to confirm, are you using the FeatureWriter with the Group By parameter set to group by the _window_id and the When Group Changes (Advanced) mode? This will ensure a new file is created when the group changes (i.e. when the next time window feature(s) arrive at the FeatureWriter).

 

image 

Attached is a simplified example that runs for about 90 seconds in FME Form and outputs a new file every 10 seconds in case that helps.


Hi @dms2​,

 

Just wanted to confirm, are you using the FeatureWriter with the Group By parameter set to group by the _window_id and the When Group Changes (Advanced) mode? This will ensure a new file is created when the group changes (i.e. when the next time window feature(s) arrive at the FeatureWriter).

 

image 

Attached is a simplified example that runs for about 90 seconds in FME Form and outputs a new file every 10 seconds in case that helps.

Thanks for the workspace example.

Yes, I did set the 'Group By' and 'Complete Groups' parameters.

After some trial and error it started working as expected just by moving the Terminator transformer further down the flow instead of right after the TimeWindower. I'm using some blocking transformers (with 'Group By' and 'Complete Groups' parameters properly set) between the TimeWindower and the FeatureWriter in a complex translation and it didn't have time to properly write and close the output json files.

Problem solved!

Thanks anyway.

 


Reply