In previous post I showed how to create a REST based service using TIBCO BW 5.x, but today I’m going to do the same using the 6.x series to highlight the differences between both of them.
We are going to start with a new fresh project without any process and no anything else inside of it. And then, we are going to launch the REST Resource wizard, as you can see in the image below:
After the wizard we have a new BusinessWorks resources that implement the methods and operations we already defined in the previous wizard dialog.
We have two operation a POST one and a GET one. In this case I’m not doing any kind of transformation or business logic inside the process because this is not the goal of this post.
But, we need to focus on the new items we have inside our process. The first thing is the new “service” element with have. In this case we can see two operations: post and get. This are related to the operation we already defined and obviously when the process paths inside it.
If we take a look at the properties we can define inside this element we have barely no one, as you can see here:
We also have a new kind of Service Descriptor coded as a JSON file, as you can see inside your Service Descriptor folder:
This JSON file defines the interface of our REST Service, as we can see in the image above. But we cannot make any changes to this interface from that resources because it is something like a “read-only resource kind”.
To do any changes we need to go to the Module Descriptor item and check the REST Binding properties as you can see here:
From here, we can do any change we want to this new REST interface and the changes will be translated to the “read-only” resource.
The only thing you cannot do from this form is to add new operation to your REST Resource. To do that you have to do it form the BW Process itself using the context-menu over the REST Interface as you can see here:
Another thing you have to keep in mind when you are working with REST Resource is that a REST Resource is implemented with the same BusinessWorks process.