Question
CVS Health
US
Last activity: 17 Sep 2021 15:54 EDT
Name value pair JSON request generation
We are working on an integration with a legacy letter generation system. Its a REST API, and the request structure is in JSON. But the JSON structure is slightly different than the common ones we use: its a name value pair.
It can be noticed that instead using Label=Business rather property name, and property value have been treated separate entities in the structure.
Questions are:
1) How to form this kind of request structure?
2) Is there any OOTB function or java code which can be leveraged to find the properties in a page, and then loop over them to form this kind of structure?
3) Let's say, instead of 2 attributes in each CR (as given below) there are 120+ properties (essentially needing to be converted to individual name-value pair). Will there be any performance bottleneck?
4) If this structure is used for 2000 CR at once, how much performance impact it may cause?
5) Let's say, along with generating this request, similar structure needs to be parsed in Pega from a file listener. Is there any specific OOTB approach which can be used to map this kind of content from file into Pega clipboard structure?
We are working on an integration with a legacy letter generation system. Its a REST API, and the request structure is in JSON. But the JSON structure is slightly different than the common ones we use: its a name value pair.
It can be noticed that instead using Label=Business rather property name, and property value have been treated separate entities in the structure.
Questions are:
1) How to form this kind of request structure?
2) Is there any OOTB function or java code which can be leveraged to find the properties in a page, and then loop over them to form this kind of structure?
3) Let's say, instead of 2 attributes in each CR (as given below) there are 120+ properties (essentially needing to be converted to individual name-value pair). Will there be any performance bottleneck?
4) If this structure is used for 2000 CR at once, how much performance impact it may cause?
5) Let's say, along with generating this request, similar structure needs to be parsed in Pega from a file listener. Is there any specific OOTB approach which can be used to map this kind of content from file into Pega clipboard structure?
{ "appName":{ "Source":"Legacy", "TotalComm":"2" }, "CRs":[ { "CR":[ { "name":"Label", "value":"Business" }, { "name":"LOB", "value":"HealthCare" } ] }, { "CommunicationRequest":[ { "name":"Label", "value":"Operations" }, { "name":"LOB", "value":"IT" } ] } ] }
Note: In case if JSON structure looks unorganized, you can use any online JSON formatter to make a pretty print.