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

[resolved] [tRESTRequest] REST API Mapping, Errors Handling/Wrong Calls

Hi everyone,
I want to have tRESTRequest components which have different output flow with the same URI pattern “/” :
https://www.talendforge.org/forum/img/members/320841/tRESTRequest-Orders.jpg
Each output flow have parameters like :
https://www.talendforge.org/forum/img/members/320841/tRESTRequest-getOrders.jpg
https://www.talendforge.org/forum/img/members/320841/tRESTRequest-getOrdersFromProvider.jpg
But when i run the job only the first output flow (getOrders) is used, and he return me an error cause i don’t use the same parameters.
It is possible to make different flow with the same URI Pattern if they don’t have same parameters (and parameters can’t be null) ? and when a parameter is null tRESTRequest use Wrong Call flow or another custom error flow ?

Edit : I also have a date error, as you can see i have a date parameter (i supposed that is a java.util.Date).
to use it in my tOracleInput i tried :
"SELECT * FROM X.Orders WHERE orderDate >= '" + (new java.sql.Date(((Date)globalMap.get("vGetOrders.after")).getTime())) + "'

But he return me an error cause the java.sql.Date is convert to string and he return 2016-01-01 instead of comparing the sql date with the oracle date.
Thanks you in advance,
CSen.
Labels (4)
2 Replies
Anonymous
Not applicable
Author

Hi, in this case have a single mapping only, then have a filter may be that will either get all orders or orders by id/provider, depending on whether id/provider is not empty.
The query parameters are not used in the JAX-RS matching algorithm, hence when you have 3 methods with the identical HTTP Verb and Path values, the selection is random or as in this case, the 1st matching method gets selected
HTH, Sergey
Anonymous
Not applicable
Author

Hi,
I just put a tMap and i use 3 different outputs and that works fine, Thanks.
For the date parameters i will probably use a String.