I've searched for a solution, but didn't find any in the forum.
Here is my case :
I have a tFileList, iterating over XML files (and sending them to a tFileInputXML component). The tFileInputXML component sends each to a tMap. This tMap has several outputs, all of them going directly to a dedicated tAdvancedOutputXML component. Depending on some source nodes, one output or another is selected.
My problem is with the XML files generated by the tAdvancedOutputXML : even if any node match the rule declared into a transformation of the tMap, a file is generated, containing only the header definition of the XML file (I mean <?xml ... ?>).
Of course, I've checked "do not generate empty file"
I do not want to have a file if there is nothing written in it. How can I do ?
Try to do something to stop the flow to the output components if there isnt anything. Perhaps a tFilterRow or a tJava component...Im curious to see if there is a way to stop the flow altogether if there isnt any data to pass through.
Also, you can try to use the tDeleteFile component if you check the file for any data...
Yeah, I understand what you mean. Unfortunately though, sometimes you have to create "band-aids" to make your design work flawlessly, meaning it looks ugly under the hood, but the results are exactly what you need.
I tried a couple of mock-ups of your issue and I cant really find a perfect solution. another idea that came to me is something like
tMap -> tJava -runif -> tOutputFileXML
In the tJava assign a value from the flow to a context parameter, and in the runif check if its null...if it is, it'll stop the flow there...
The version I use is 3.2.3 r35442. The clue, to explain this behavior, is that my FileInputXML read several files, and maybe send for each file an "information" to the output components, triggering the creation of a file, even if there is no data ?
My main wish is to merge all the data into a single output file, but when I specify a constant output file name in tAdvancedOutputXML, a new file overrides the previous one. That's why each tAdvancedOuputXML has, as its output file name, a dynamic one, based on a sequence : "MY_PATH" + Numeric.sequence("seq",1,1) + ".xml".
If you can help me to solve this need (merge all the data into a single output file), it will solve my first problem (empty output files).
Please note that I've tried to solve this (merging the output) using tUnite, but as you have seen in another post, I wasn't able to make tUnite work in my job (odd messages about non final variables access error with inner classes...)
I hope I've given you enough information to make this as clear as possible.
I have an issue with "Create empty element if needed " in tAdvancedoutputfilexml" component. I am creating an xml document by mapping from tXMLmap. I do not want empty elemnts/tags to be created when there is no value in xml. I have uncheck the parameter "Create empty element if needed " in "Advanced setting" of tAdvancedoutputfilexml" component. But still the empty tags getting created. Could you please let me the if there any way I can avoid creating tags when there is no value from mapping?