Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » How to handle Exception in Rest service call application(How to handle Exception in Rest service call application)
How to handle Exception in Rest service call application [message #1714446] Thu, 12 November 2015 17:26 Go to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
How to handle Exception in Rest service call application

I am calling a rest service which is failing at their end so how can I handle it in my model . As when the service fails my model is getting interrupted.

Also in their any way for converting model from interrupted state to Active.

[Updated on: Thu, 12 November 2015 17:52]

Report message to a moderator

Re: How to handle Exception in Rest service call application [message #1714716 is a reply to message #1714446] Mon, 16 November 2015 07:58 Go to previous messageGo to next message
Fradj Zayen is currently offline Fradj ZayenFriend
Messages: 6
Registered: October 2011
Location: Tunis, Tunisia
Junior Member
Hi,
you need to add onException block in your defaultCamelContext

<camelContext ...>
<onException>
<exception>java.lang.RuntimeException</exception>
<handled><constant>true</constant></handled>
</onException>
...
</camelContext>

This will prevent the current transaction to rollback.
then you can use event handler mechanism to catch the error at Process level.

Regards
Re: How to handle Exception in Rest service call application [message #1714750 is a reply to message #1714716] Mon, 16 November 2015 12:07 Go to previous messageGo to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Thanks for the reply.

Can you please provide detail example of it. whole camel which makes a web service REST post call throguh Rest application . where the exception code needs to be added in that call. Please give a sample example or code
Re: How to handle Exception in Rest service call application [message #1715209 is a reply to message #1714750] Fri, 20 November 2015 09:23 Go to previous messageGo to next message
Ashish Khole is currently offline Ashish KholeFriend
Messages: 28
Registered: April 2015
Junior Member
Hi Patil,

Please find attached sample model for Exception handling(I/O exception Handled).

Best Regards
Ashish
Re: How to handle Exception in Rest service call application [message #1715270 is a reply to message #1715209] Fri, 20 November 2015 17:35 Go to previous messageGo to next message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Thanks Ashish,

I understood your example. But you showing Error to user and If user completes the activity the process will end.

But I don't want the process should end. The person should contact administrator, once the admin fix the web service issues the person should resubmit the web service data back to service ... get success and go for next activity in process.
Re: How to handle Exception in Rest service call application [message #1715682 is a reply to message #1715270] Wed, 25 November 2015 09:08 Go to previous message
Ts Patil is currently offline Ts PatilFriend
Messages: 32
Registered: September 2015
Member
Any update on this??
Previous Topic:Problems deploying to Tomcat
Next Topic:Stardust 3.0.1 support for BPMN 2.0
Goto Forum:
  


Current Time: Tue Mar 19 02:10:50 GMT 2024

Powered by FUDForum. Page generated in 0.01840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top