Hello,i'm working on this component. I read all row of a file, and after i read a group of them i do some operation on the rows. The problem is that the job don't add the last rows to the result, this because my code "don't knows" that is the last row . There is a method that i can say to the component attention this is the last row? Sorry for my bad english
Put the code that needs to be fired on the last row in the "End Code" section, which is fired after the last row, if that will work. There is no method to identify the last row I'm afraid. Otherwise you *could* get the number of rows from the source component (in a different subjob) and then keep a count in the Main Code section of your JavaFlex. Then compare the total number of rows with the count.
What exactly are you trying to do. I just reread your initial post and it looks like you are trying to do something over all of the rows. If that is the case, calling a method on the last row will not work. The tJavaFlex calls the MainCode on every row. It doesn't automatically "remember" previous rows unless you build that functionality in. If you tell us exactly what you want to achieve, we can maybe help you out.
I have a table and i'm looking all of his rows. Now some of this rows have a coloumn that have the same value, it's a thing like an ID. Now all rows that have the same "ID" i have to sum all the value and save this value in a variable. The problem is that when he find the last row the job don't recognize it and the code end. If in the end code of the tjavaflex i insert statement like put in the output line this value, nothing heppened.
i need to use tjava flex because i need to do some logical operation too. You have other idea? because when i try in the end code to look what is write on the row i find the correct value, but i don't find this row after the tjavaflex component
OK, well you don't actually need to know when the last column is reached. If you need to perform logic that cannot be performed in any other way, why not create a data class to hold your data and create a new object for each instance of a new key. Store these objects in a HashMap. For every row that comes in, check to see if the object exists in the HashMap. If it does, retrieve it and perform whatever action you want to perform on the data. If it does not, then create a new instance of the object, add the data and then add it to the HashMap. At the end of the tJavaFlex reference the HashMap using a globalMap. Then in another tJavaFlex you can iterate over the HashMap and output your data in rows. A loose example of this sort of processing can be found here (https://www.rilhia.com/tutorials/load-data-dynamic-number-files). In this example, I am writing data to different files created and stored in a HashMap.