Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
I have a subjob with the design below:
tHashInput -> tFlowtoIterate -> tFixedFlowInput ->tJavaRow -> tRestClient -> and so on...
So inside the tHashInput, I have a field called EmpDN which I want to be used as a parameter in tRestClient. To do this, I put the tFlowtoIterate and tFixedFlowInput, to get the EmpDN row by row value, and store it accordingly in a context variable via tJavaRow. The problem is, when the first output of EmpDN that has been stored in context and be used respectively in tRestClient as a parameter and the response is an error or HTTP 404 Not Found, the job will stop already.
What I want to happen is, even if the tRestClient responded an error, it should still continue to iterate on the next value and so on.
Can you please help me how to achieve this?
Thank you in advance!
Hi,
Something like:
tHashInput -> tFlowtoIterate -> tJavaFlex (iterate) -> tFixedFlowInput ->tJavaRow -> tRestClient ->
With the tJavaFlex setup like:
Start Code
globalMap.put("RestFailure", false);
try {
Main Code
(nothing)
End Code
} catch (Exception ex) {
globalMap.put("RestFailure", true);
}
Hi,
Couple of things to check/try.
1/ Untick the "Die on error" on the tRestClient component.
2/ Use a tJavaFlex component with the Java code of "try" & "catch", so you can handle the failure yourself/cleanly.
Thanks
David
Hi David,
Thank you for your response. Die on error is already untick, but I haven't tried the tJavaflex.
Can you expound how to use the tJavaFlex, and where to incorporate it on my current design? Thank you in advance.
Hi,
Something like:
tHashInput -> tFlowtoIterate -> tJavaFlex (iterate) -> tFixedFlowInput ->tJavaRow -> tRestClient ->
With the tJavaFlex setup like:
Start Code
globalMap.put("RestFailure", false);
try {
Main Code
(nothing)
End Code
} catch (Exception ex) {
globalMap.put("RestFailure", true);
}
Thanks, David!
I really hadn't realized one could use tJavaFlex to handle try/catch, but it makes sense now that you say it.
Big thanks!
Regards, Jan Terje