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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

incorrect flow happening from tRestRequest

I have a webservice which is going to create a user (using POST) and then, send user details back when GET request is used.

Something like this:


0683p000009MFha.png

When I am disable either one, it gives the correct output. However, when I have both active, both the routes activate.

What am I doing wrong?


0683p000009MFhf.png

As you can see in the screenshot above, d(main order 5) is for "GET" and c(main order 4) is for POST

I did a "GET" request and both the scenarios got triggered, and a "new" user creation was triggered. At same time, the user check was done, but, it was unable to send data back as POST had already executed and sent a response back to the client (user creation success).

What do I need to do here to get it working? Please advise.
Labels (2)
5 Replies
Anonymous
Not applicable

Can you change the the URI patterns? I have to admit I have never tried having such similar patterns, but I suspect the fact that you are using "/users" and "/users/{id}" is the cause of this. If you change them to "/createuser" and "/getuser/{id}" I suspect this problem will go.
root
Creator II
Creator II
Author

rhall_2.0 wrote:
Can you change the the URI patterns? I have to admit I have never tried having such similar patterns, but I suspect the fact that you are using "/users" and "/users/{id}" is the cause of this. If you change them to "/createuser" and "/getuser/{id}" I suspect this problem will go.

Thanks. I tried this too.

But, still, it is not helping me here. I am not sure what is causing it to go crazy. Any way to debug what is going on wrong here?
Anonymous
Not applicable

I know what it is. I just had another look at your job/service design. This is caused by the OnComponentOK links. After those, you have DB queries. These are being fired because even though there is no data going to the component before, it is finishing "OK". Therefore the query component is firing. Replace the OnComponentOK links with IF links, using something that will only fire if that route is OK to use.

It is a bit of a pain, but I remember when I worked for Talend the expectation was that services wouldn't use subjobs like this. Using them is not a massive issue, but you have to work around them. 
root
Creator II
Creator II
Author

rhall_2.0 wrote:
I know what it is. I just had another look at your job/service design. This is caused by the OnComponentOK links. After those, you have DB queries. These are being fired because even though there is no data going to the component before, it is finishing "OK". Therefore the query component is firing. Replace the OnComponentOK links with IF links, using something that will only fire if that route is OK to use.

It is a bit of a pain, but I remember when I worked for Talend the expectation was that services wouldn't use subjobs like this. Using them is not a massive issue, but you have to work around them. 

I had a hunch that would be a problem (on component OK), but, you confirmed it.

Well, it took me some time to figure out what type of conditions to add, but, that seems to work for now. I have been able to get it working with the same URL:

/users/ (POST) && /users/{id}/ (GET)

Fingers crossed, hopefully this setup workaround may work...

Thanks a bunch for your insights.
Anonymous
Not applicable

Yes, /users/ & /users/{id} would never clash, it is a fundamental part of a JAX-RS selection algorithm