Update: I know i can use the AttributeCreator to make groupID's by setting the attribute value as '@Evaluate(@int(@Count()/500))' - but im not any closer on working out how to feed each group individually through the JSONTemplater to create separate documents.
My thoughts are that I would set a counter value as 0, pass all documents with the groupID equal to the counter through the templater, write these to JSON and then loop back to the start, incrementing the counter by 1 and running the process repeatedly until it reaches the end. However, I have no idea if this is feasible in FME.
Any suggestions?
Update #2: I have managed to create what I am looking for manually thus far - but it is entirely unscalable. I've attached a couple of images to show the growth of the files from 1 root document to 2.
First the manual solution, that returns the data in the manner that I would be able to use it:
Then what happens when I attempt it for 2 files:
Considering that there are approx. 29,500 files to go through, I am hoping that someone can see a way to clear the mess down and suggest a simpler solution.
Hi @majobajob, sounds you are looking for a way to create copies of a common root feature for every group. If I understood the requirement correctly, this mockup might help you. You can use the FeatureMerger to merge attributes from a single Supplier feature to every Requestor feature, if you set an identical constant value (e.g. 1) to the Join On parameter for both Requestor and Supplier.
Hi @majobajob, sounds you are looking for a way to create copies of a common root feature for every group. If I understood the requirement correctly, this mockup might help you. You can use the FeatureMerger to merge attributes from a single Supplier feature to every Requestor feature, if you set an identical constant value (e.g. 1) to the Join On parameter for both Requestor and Supplier.
Hi Takashi, Thank you so much for sharing this. The logic seems to show exactly what I want to achieve. I'll build it in and test it later this evening and let you know the result. Thanks again!
Hi @majobajob, sounds you are looking for a way to create copies of a common root feature for every group. If I understood the requirement correctly, this mockup might help you. You can use the FeatureMerger to merge attributes from a single Supplier feature to every Requestor feature, if you set an identical constant value (e.g. 1) to the Join On parameter for both Requestor and Supplier.
Hi again Takashi, this was a great answer. Did everything I needed with little to no amendments