Question

Mapto and Mapfrom utility functions usage in Integration

Hello Experts,

I would like get clarified on below as nowhere I can get clear information although I can use the artifact which is the point of this post without understanding.

REST INTEGRATION ---> Service-REST:

Incoming Request --> JSON format

Outgoing Response --> JSON format

How to map incoming JSON request as part of POST method request tab?

[Same sort of question applies to response tab Map From and Map From Key]

Map to: ____

Map to key: _____

Below (at the bottom) is what has been explianed in Pega help documents where I feel contradiction between Clipboard and JSON usage for Map to field.

1. Why the label Map To is used in request tab when Map to Key is going to be a page/pagelist property on Clipboard?

The label can be Map From where we can get the incoming data format which is JSON.

2. If Map To label is justified as where to we need to map incoming data, then Clipboard will be the choice to opt given that we want to map incoming JSON data to Clipboard.

In this case, why should I give JSON as the selected option for Map To as per the explanation given below in pega help document?

Map To Specify the destination or the type of destination for the value in the Pega Platform :
  • Clipboard — Map to the page name or property on the clipboard specified by Map To Key field.
  • XML ParseRule — The incoming data is a stream of XML that must be parsed using the actions defined in a parse XML rule (an instance of the Rule-Parse-XML rule type).
  • JSON — The incoming data is a JSON formatted stream that must be mapped to a Page or a Page List property on the clipboard.

Comments

Keep up to date on this post and subscribe to comments

September 7, 2019 - 8:21am

Hi,

For parsing the inbound JSON request by the Service-REST, you need to use Map To as JSON to convert JSON request and map the elements to a page or pagelist in the clipboard.  The Pega data model to which you are mapping is replica of the JSON content (key value pairs). You don't need to map the keys and values explicitly. The JSON content is converted and mapped to the clipboard structure per your data model in this case.

Thanks 

 

September 9, 2019 - 6:22am
Response to SibasisMohanty

Hi Mohanty,

Thanks for your inputs.

But my question is not about how JSON mapping works. It is about, why the labeling of the fields (Map to, Map From) on the request/response tab is such way? It is confusing me as why Pega uses Map to and Map from labels interchangeably although I know what to do to make it work by referring Pega Help documentation.