To adhere to firmwide policies, our interface partner is converting an existing soap service to a JSON based REST service. The only possible way to connect to a REST service in PEGA 6.1 is through Connect-Http rule. I found one relevant post but i did not get a clear picture on what this requirement entails. Could anyone please list out all the necessary steps needed to achieve this requirement? Our application is divest and hence we are not planning for a PEGA upgrade.
You will have to write your own JSON parser and streamer, perhaps by leveraging a third-party library such as Jackson. You could create two RUFs - to convert JSON to Clipboard and vice-versa. You will have to configure your HTTP connector such that the response is mapped to a single-value property which your RUF takes as input along with the target ClipboardPage you need to map the response to. Likewise, the streamer RUF takes ClipboardPage as input and outputs a string containing the JSON. This string can be copied to the parameter page or a temp property and referenced in the HTTP connector request tab.
Posted: 2 years ago
Posted: 20 Feb 2020 13:25 EST
sravya kanagala (sravyak6081)
I see that the ObjectMapper class of the Jackson API provides methods to convert a Java object to JSON object and vice versa. But, how do we convert a Clipboard page into a Java Object or JSON string. I tried to search engine API in 6.1 but i do not seem to find one that does the conversion. Any clues on this?
Posted: 2 years ago
Posted: 20 Feb 2020 23:34 EST
Praneeth Purighalla (PraneethPurighalla)
Lead System Architect
You will have to iterate through the Clipboard page properties and construct the JSON string manually based on the property type. The following methods might help:
ClipboardPage.values() - returns a collection of properties on this page
Iterate through the collection returned above, each item is of type ClipboardProperty.
Use ClipboardProperty.getMode() to identify if it is a single-value property or a complex property (page/page list/page group, etc.) and ClipboardProperty.getType() to identify if it is a string/number/boolean and construct JSON string accordingly.