cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Router in HCI

markbernabe
Active Participant

Hi Experts,

This is my scenario:

The Process Call will call a local process that would call a RESTful GET web service. The response of the web service is either HTTP Status 200 or 206. Hence, I used the following condition in my Router: ${header.CamelHttpResponseCode} = '200' for OK. NOT OK is the default since the initial call always ends up in this status so I have to loop the call again until it becomes 200 / OK.

When I try deploy the iFlow, I'm not getting any errors but it's not getting deployed.

If I remove the Router and simply routes the Reply to the End event, it's getting deployed successfully.

Any ideas why? Did I use the router here incorrectly? I've also tried using it in the parent process but to no avail.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mark,

There is a way to do it.Its not required to have Router in this Location Integration Process.

I guess you want to loop this Local Integration Process to make sure you will go ahead once you get the status code 200 OK.You can right click on the Process Call and make it as Looping Process.When you get a HTTP Response Code as 206 looping process will get triggered again and when it returns you 200 call will get completed sending back the data to main integration process.

Regards,

Sriprasad Shivaram Bhat

markbernabe
Active Participant
0 Kudos

Hi Sriprasad,

Thanks for the info. Yep, I've actually tried that as well as shown in the snapshot but it doesn't seem to iterate. Since the first call always ends up in 206, I'm expecting the Process Call to trigger the Local Integration Process but it just moves forward to the last Modifier right away.

Answers (4)

Answers (4)

h_alvarez0
Discoverer
0 Kudos

i have a different scenario but i am trying to use the ${header.CamelHttpResponseCode} = '200' condition to make desicions in in the routing object.

i am getting the following error

markbernabe
Active Participant
0 Kudos

Can you change the expression type to non-XML?

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mark,

Yes I got your point it works as While() loop not Do..While () .I can see 2 messages just before Request Reply can you verify whether it contains both 200 and 206 responses,can you just verify those.?

If both the status messages are present Looping Process works fine and it will return the messages which satisfied the condition and it will not return when condition gets failed.

Let me check on the earlier solution which you proposed and revert back with my findings or any options.

Regards,

Sriprasad Shivaram Bhat

markbernabe
Active Participant
0 Kudos

Hi Sriprasad,

Oh yeah it's working. I tried again and there are 100 messages in the trace. The status is still 206 after 100 iterations. Guess I need to add some script to delay/sleep since it takes a while until a request gets 200 status.

Thanks!

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mark.

Good to hear that i think you can change that no of iterations to 99999( Max Value ),so that it will be looped till you get 200 status code.

Regards,

Sriprasad Shivaram Bhat

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mark,

I have tried the above one it worked fine for me it works like While() loop.Could you please share the output after the Process Call I think it should have both 200 and 206 status code response.

Regards,

Sriprasad Shivaram Bhat

markbernabe
Active Participant
0 Kudos

Hi Sriprasad,

Would I see this in the Trace? In the final Content Modifier, I created a body that will be filled with the status code.

And everytime I run it, I always get 206.

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mark,

Could you please check in your Component status overview once ,if Integration project in error could you please share the tail log.

Regards,

Sriprasad Shivaram Bhat

markbernabe
Active Participant
0 Kudos

Hi Sriprasad,

The Runtime Status is 'started' and Sync Status is 'synchronized'. But in the deployed artifact, the Deployed On time is never updated.

markbernabe
Active Participant
0 Kudos

Hi Sriprasad,

If I point the Router to both End Events, then I can deploy the iFlow successfully. So I guess it's not possible to assign the Router to a Request Reply Service call. In that case, how can I make a loop to trigger the GET request while it's still not 200?