Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend Display null as empty array

I new at talend stuck with a basic issue ,any help would be really appreicated I have a talend esb job that let me query my database via get request
Job Flow: 
Trestrequest==>tflowIterate==>Redshift==>txmlmap==>trestresponse


Call:
localhost/restaurant?rest_id=305&from_date=%272016-10-12%27&to_date=%272016-10-18%27&_=1476875037045

get the result(Json response)
{"root":{"combo3":[{"class1":11963,"class2":12405,"class3":13050,"count":12}

which is perfect and what is required
How can I handle 404 exception
for Talend ESB and display {}

(in web page or web browser)
Right now I only see empty webpage as result but how can I replace it with   {} (in web page or web browser)
Labels (5)
1 Reply
Anonymous
Not applicable
Author

Hi 
404 exception means no data found, you may check if any data are found from database and then send different result as response based on the checking result, eg:
Trestrequest==>tflowIterate==>Redshift==tHashOutput--runIf1--tHashInput-->txmlmap==>trestresponse1
                                                                                   --runIf2--tFixedFlowInput--> trestresponse1

set the condition of runif1 as:
((Integer)globalMap.get("tRedshiftInput_1_NB_LINE"))>0

tHashInput: read the data from memory, check 'clear cache after reading' box.




set the condition of runif2 as:
((Integer)globalMap.get("tRedshiftInput_1_NB_LINE"))==0

tFixedFlowInput:define the return value "{}" if no data are found from database.


Regards
Shong