Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to be able to check the response of an API call and document that the result was null
I currently have a job that reads a series of API parameters from a database and does separate API calls for each set. Most of them work but if there is no data for that day from the vendor the API just returns a null which causes an error in the translation. I would like to be able to make a condition that would read before the error and allow me to write into a separate DB table that it came back with no results and return to the calling process for the next set.
I currently have a tDBInput --> tFlowTolerate --> tRunJob that calls the API process tRestClient --> tExtractJsonFields --> tdbOutput which runs but I do get an error when trying to translate the API calls that return nulls.
Thank you for any help
Hi
Which step throws the error? tDBOutput? If so, you can change the child job as below:
tRestClient --> tExtractJsonFields --> tJavaFelx--tHashOutput1(cache the records into memory)
--runIf--tHashInput1--main-->tdbOutput
on tJavaFlex:
begin part:
int counter=0;
main part:
counter++;
end part:
globalMap.put("keyName",counter);
set the condition of runIf as:
(Integer)globalMap.get("keyName")>0
in this job, use a runIf connector to trigger next process based on the condition.
Regards
Shong