I have my components set up as the attached image shows. Before I added the tJavaRow component it did not have any errors and it ran correctly. After adding the tJavaRow I got General The method tMysqlInput_1Process(Map<String,Object>) is undefined for the type DBtoXML10 tMysqlInput A component that is not a sub process start can not have any link on sub job ok / on sub job error in input. Currently the only code in the tjava row is this ( I will add additional later) output_row.ID = input_row.ID; output_row.title = input_row.title; output_row.sub_title = input_row.sub_title;
The problem is OnSubjobOK must go to/from the start component of the subjob (the one with a green background). In your job that is tMysqlInput_2 (because that is merge order 1) but OnSubjobOK is linked to tMysqlInput_1, which is why the latter has an error mark against it.
I am having an additional problem In the tJavaRow I have a context variable context.fileNumber every 5000 records this is incremmented by 1. In the File Name text field of the tFileOutputMSXML i have enter "C:/opt/ftp/talend/XMLFiles/out"+context.fileNumber+".xml" I have added printstatements to the tJaveRow that show the variable incrementing correctly but only the one XML file is created. Is it possible to split the files using this method?
No; the output file is created before the flow starts. I've never used tFileOutputMSXML so I'm not sure how to resolve this because it takes multiple flows. The usual suggestion for a single flow is to use tFlowToIterate and tFixedFlowInput before the output, although this would likely be way too slow for so many rows. Other ways, again for a single flow, might be to: 1. store the final row data in a temporary file or hash and then as a subsequent subjob execute a loop for the number of files you need, re-reading the temporary file or hash, filtering based on the fileNumber and writing to each xml file. 2. write the final row data to a delimited file, using the ability to split to multiple files and then as a subsequent subjob iterate over the created files to write them as xml. If you can't figure out a way to achieve something like that with your data then I suggest you create a new topic for more help from someone else.