I'm trying to extract XML data from a website using the tRestClient API, in the first step i am getting value max_page from Mysql database, then it used for URL in tRestClient and the next step parsing the XML with tExtractXMLField and then saved into databases
but i need to repeat my job from first step if tExtractXMLField column status = SUCCESS, and stop when column status = FAILED
You can do this with a tLoop and a globalMap variable. For an example of something similar (similar in that a loop carries on until something in the processing changes) take a look here: https://www.rilhia.com/tutorials/using-talend-get-your-spotify-listening-history-facebook
Look for the section with the heading "The GetMySpotifyListeningHistory Job" and take a look at how that works.
Essentially you want to create a globalMap variable to hold your status value. Base the tLoop on the contents of that value (true/false). Pre-set that globalMap with the value true. Base the tLoop logic on the presence of "true" in the globalMap variable.
You can store your success value in the globalMap for every row either using a tJavaFlex or a tSetGlobalvar component.
Tag as "solved" for others! Kudos to thanks!
Sorry about my site @ScottLeckie. My server was attacked by some Russian hackers (according to their IP addresses anyway) and I had to take it down. Unfortunately I have not been able to find the time to rebuild it. I will get the tutorials back online as soon as I can though.
In the meantime, the way to approach this problem is to use a tLoop with a While loop based on a value that can be changed after each loop. In my example I used the While loop's conditional variable to hold the URL I needed the web service to call. Before the tLoop I would set the initial URL and use the tLoop to iterate over service calls. Each time the service was called it would return some XML and if the results required another service call, it would supply another URL. I would extract that from the dataset and add it to the tLoop's conditional variable that the While loop is based on. If there was no URL returned, I would set the conditional variable to null and that would stop the tLoop.