Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
Im very surprised how the component reacts when run flow, and branch have 0 Row. (for me it is a bug on 7.2.1.20190620)
with config :
Advance :
FLOW :
RESULT :
Hi
Can you share a screenshot of basic setting of tAdvancedFileOutputXML component? I guess you are using global variables in the file path.
Regards
Shong
plz see my first screenshot it is the basic setting 😞
yes i use the globalVar with component FlowToIterate. But in tMap_4 output with 0 ROW i dont understand why my component tAdvancedFileOutputXML want create empty file and generate path with 0 ROW (and globalVar are null because 0 ROW) and create /null/null/ (with my end path with globalVar).
why the generate path for the file of tAdvancedFileOutpoutXML only if minimum 1 row in the flow line ?
thanks
Hi
Please refer to this documentation about the component code generated model. In a main flow, the begin part code (initializes variables, such as filepath, opens an output stream) of tAdvancedFileOutputXML executes before other components. In this case, you are using the global variable before it is assigned value, that's why it is null.
If you want to create the XML file only when the output of tMap has data, then store the output into memory using tHashOutput, use runIf connector to trigger next processing if the global variable (Integer)globalMap.get("tHashOutput_1_NB_LINE") is bigger than 0.
for example:
....tMap--tHashOutput_1
-runIf-tHashInput--main-->tFlowToIterate--tFixedFlowInput--main--balabala-->tAdvancedFileOuutput
set the condition of runif as;
((Integer)globalMap.get("tHashOutput_1_NB_LINE"))>0
Regards
Shong
sorry if I speak poorly in English.
this effectively works with an if, but the tAdvancedFileOutputXML component then no longer consolidates the xmls in the same file, it overwrites the file per row received and no longer adds in the groups and loops defined in the xml tree.
And so I have a file with only the last xml in the loop 😞
Do you check the 'Append the source xml file' box on tAdvancedFileOutputXML? Can you take a look at the tUnite component? This component merges all the data, in your case, you can use this component to merge all data before writing them to XML file, let me know if I don't understand your requirement well.