Hello everybody,
attached is the job I'm trying to make.
What I want is simply download a file with a tFileFetch and when it throws a error or exception loop it again until it succeed (I'm using a while loop).
When I pass a wrong uri to my tFileFetch, it loops exactly the way I expected. But when I pass the correct uri, it stills loop infinite times.
The question is, how can I know when my tFileFetch downloaded the file or when it throws a exception/error.
Hi guys,
thank you all for the responses and help.
I solve it using a run if in my tFileFetch, checking if the file exists.
For this problem, it will work and I believe I won't have future problems with this solution. But the problem is that I am not getting the error or exception of the tFileFetch component (it could be a timeout, a bad request, etc) and I believe it would be interesting to have this kind of control on this component.
My job is working and if someone needs it in the future, the solution is attached. I put the run if on the tFileFetch component because I want to overwrite the file if it exists (only one time =D).
Hi Gabriel...
Set some flag at the end of file download...
Modify design and use RunIf condition on flag status, this will execute the download in case flag is unset ...
Vaibhav
Hi Vaibhav
I already tried it with tJavaRow, tJava and tJavaFlex with somthing like:
if(new java.io.File(context.filepath + "//" + context.filename).exists()){
globalMap.put("go_again", false);
}
but it didnt work (I don't know why...I think it should work)
How about something like this instead? With the FileExists, you're breaking up the subjob, which in your case (being the same across) is causing the multiple downloads for each iteration. Hope this helps...
Hi Gabriel,
You have onSubJobOk link from loop... so, that subjob will continue forever
You will have to use one more link ahead of your last component and change the loop condition or break the loop...
Or use RunIf from loop while checking file download step for each iteration..
Vaibhav
Hi guys,
thank you all for the responses and help.
I solve it using a run if in my tFileFetch, checking if the file exists.
For this problem, it will work and I believe I won't have future problems with this solution. But the problem is that I am not getting the error or exception of the tFileFetch component (it could be a timeout, a bad request, etc) and I believe it would be interesting to have this kind of control on this component.
My job is working and if someone needs it in the future, the solution is attached. I put the run if on the tFileFetch component because I want to overwrite the file if it exists (only one time =D).
Hi Gabriel, Good that it resolved, whether the solution is same as Will have uploaded... if not can you pl upload the screenshot of your design? thanks vaibhav