Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » Using Rest Web Services in Stardust(How to use rest services in Stardust)
Using Rest Web Services in Stardust [message #1221859] Wed, 18 December 2013 15:06 Go to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hi,

We have been successfully using SOAP based web services in our test Processes in Stardust BPMS tool untill now and would like to continue testing our processes using Restful Web Services.

We did try to find some documentation on the same and got our hands on the example on 'Using External Web Applications in Process Models' [1].
But this example did not fit our need. Thus, it will be great if you could point us to some other documentation on the same topic.

Thanks in Advance!

Cheers!
Kunal


[1] http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.stardust.docs.dev%2Fhtml%2Fhandbooks%2Fmodelling%2Fintegration%2Factivity-panel-integration.html
Re: Using Rest Web Services in Stardust [message #1228892 is a reply to message #1221859] Wed, 08 January 2014 09:43 Go to previous messageGo to next message
Vikash Pandey is currently offline Vikash PandeyFriend
Messages: 12
Registered: October 2011
Junior Member
There are 3 operations exposed over REST:
interactions
processes
typeDeclarations.

For any running IPP instance, we can get the list of operations/services with:
http://localhost:8081/lifecycle-management/services/rest/engine?_wadl
(Adjust server, port and web app context accordingly).

intearctions is explained in detail at:
https://wiki.eclipse.org/Stardust/Knowledge_Base/Integration/UI/UIMashup/AngularJS

https://wiki.eclipse.org/Stardust/Knowledge_Base/Integration/UI/UIMashup

processes is explained at:
https://wiki.eclipse.org/Stardust/Knowledge_Base/Web_Service_API/Starting_Processes_Interface_And_Fetching_Results_over_REST
Re: Using Rest Web Services in Stardust [message #1228911 is a reply to message #1228892] Wed, 08 January 2014 10:31 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Dear Vikash,

Thanks for your time and reply! Smile

I am sorry if my question was not very clear.

I wanted to ask the Stardust team, the different ways in which someone can use any external RESTful Web service in any Business Process. (Currently we can use any SOAP service trough its WSDL in Stardust).

I feel your above reply is more on about 'how to use the Stardust Business processes exposed as a Rest Service on any browser or tool like SOAPUI'. Please correct me if otherwise. This explanation will be of great use to me in near future as we were thinking to use and test BP's over browsers too.

But, I would like to take your help to guide me through the ways in which anyone could use an external restful web service let's say Google Maps API in a business process.

Also, I did see in the upcoming Eclipsecon 2014 [1] there was a talk to be held by Marc Gille on Stardust describing ways to connect to Web/REST Services. Thus, I was assuming may be there would be some new releases soon for integrating External Restful services in Stardust Business Processes.

[1] https://www.eclipsecon.org/na2014/session/complex-bpm-solution-developed-and-deployed-30-minutes

Please let me know your thoughts on my question.

Thanks!
Kunal
Re: Using Rest Web Services in Stardust [message #1228931 is a reply to message #1228911] Wed, 08 January 2014 11:17 Go to previous messageGo to next message
Vikash Pandey is currently offline Vikash PandeyFriend
Messages: 12
Registered: October 2011
Junior Member
To start IPP processes:
Straight through process with synchronous flag as 'true'
http://localhost:9090/TestProject73/services/rest/engine/processes/NewProcess?stardust-bpm-partition=default&synchronously=true&stardust-bpm-model=Test73Model
Straight through process with synchronous flag as 'false'
http://localhost:9090/TestProject73/services/rest/engine/processes/NewProcess?stardust-bpm-partition=default&synchronously=false&stardust-bpm-model=Test73Model
Not straight through process
Any of the above mentioned URLs to start the process instance and then
http://localhost:9090/TestProject73/services/rest/engine/processes/NewProcess?stardust-bpm-partition=default&piOID=<<processInstanceOID>>&stardust-bpm-model=Test73Model
With this URL, stardust-bpm-partition becomes optional, the data can be fetched with this URL as well:
http://localhost:9090/TestProject73/services/rest/engine/processes/NewProcess?stardust-bpm-model=Test73Model&piOID=<<processInstanceOID>>

Similarly to set out Data to an ipp activity (PUT) (mostly used in case of embeded UI):

http://localhost:9090/TestProject73/services/rest/engine/interactions/{interactionId}/outData{interactionId}
http://localhost:9090/TestProject73/services/rest/engine/interactions/{interactionId}/outData/{parameterId}{interactionId}

to read data from an ipp activity (GET)
http://localhost:9090/TestProject73/services/rest/engine/interactions/{interactionId}/inData/{parameterId}{interactionId}


You can use these REST URLs to consume it from any REST client (Camel REST endpoint etc.).

If i get your query correctly, you are looking for ways to consume REST services exposed and hosted somewhere in Stardust i.e. you are looking to use Stardust as a REST consumer. You can use Stardust's Camel Producer/Consumer routes to consume any REST services, e.g.



<setHeader headerName="CamelHttpMethod"><constant>GET</constant></setHeader>
<setHeader headerName="CamelHttpUri">
<simple>http://localhost:8080/MyFisrtRESTService/pretech/cardNo?cardNo=${header.cardNo}</simple>
</setHeader>
<to uri="http://isoverwritten" />
<convertBodyTo type="java.lang.String"/>

Using this route i consume a REST service hosted on my localhost.
Re: Using Rest Web Services in Stardust [message #1229046 is a reply to message #1228931] Wed, 08 January 2014 15:46 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hi Vikash,

Thanks for your reply!

I saw the wiki page [1] and I did understand the concept that you are explaining there.

Also, in your last response

Quote:

<setHeader headerName="CamelHttpMethod"><constant>GET</constant></setHeader>
<setHeader headerName="CamelHttpUri">
<simple>http://localhost:8080/MyFisrtRESTService/pretech/cardNo?cardNo=${header.cardNo}</simple>
</setHeader>
<to uri="http://isoverwritten" />
<convertBodyTo type="java.lang.String"/>


You are saying that I can use any external RESTFul service exposed by me, or any third party like google in stardust processes using the camel route in my BP

Thus, the way I am understanding this is that there is no direct way to use a REST URL or a WADL directly in any predefined web service container present under Applications or Int. Applications area (in left panel) and then connecting this container to an activity in a process. In the end we have to use a REST service through a Camel Route? (Please correct me if I am not getting this part right)

Like for e.g, in case of any SOAP based service, we can directly include the WSDL of that Web service into the 'Web Service Application' that we can get from the 'Applications' in the left pallet, provide the input and output data and start using the web service in the Business Process.

Thus, I would request you to please provide any pointers or links to documentation showing how one can use a camel route with a REST service to get some results in any Business Process ?

[1]https://wiki.eclipse.org/Stardust/Knowledge_Base/Web_Service_API/Starting_Processes_Interface_And_Fetching_Results_over_REST

Thanks !
Kunal
Re: Using Rest Web Services in Stardust [message #1229412 is a reply to message #1229046] Thu, 09 January 2014 11:45 Go to previous messageGo to next message
Vikash Pandey is currently offline Vikash PandeyFriend
Messages: 12
Registered: October 2011
Junior Member
Kunal,
Please refer to this link: https://wiki.eclipse.org/Stardust/Knowledge_Base/Integration/Camel/Calling_RESTful_Service_Through_Camel_Route

-Vikash
Re: Using Rest Web Services in Stardust [message #1229432 is a reply to message #1229412] Thu, 09 January 2014 12:38 Go to previous message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hi Vikash,

The wiki doc looks Great! I will try to understand and use the example mentioned in the wiki page.

Thanks!
Kunal

Previous Topic:Proxy setting for using external Web Services
Next Topic:Invoking process using REST
Goto Forum:
  


Current Time: Sat Dec 20 00:21:25 GMT 2014

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

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