Question

2
Replies
113
Views
Arnab Sadhukhan (ArnabS68)
Capgemini

Capgemini
IN
ArnabS68 Member since 2018 1 post
Capgemini
Posted: October 30, 2020
Last activity: October 30, 2020
Posted: 30 Oct 2020 0:44 EDT
Last activity: 30 Oct 2020 8:07 EDT

Issue while using pxConvertStringToPage to handle REST exception

Hi All,

We were getting 'exception occurred while mapping incoming response to .response_get' while calling a REST service(REST service was initially consumed using Pega wizard). As suggested in many articles (like this: https://collaborate.pega.com/question/exception-occured-while-mapping-incoming-response-responseget)- we tried using clipboard property for mapping response and later converting response into json page using 'pxConvertStringToPage' function. We were mapping results in the following way-

Clipboard property->Converted JSON page->Datasource.response_GET

Now this approach is not working for properties for which PEGA OOTB connector wizard create properties with different identifier

Normally Pega creates such properties with qualifier  'pzExternalName' equal to the original JSON attribute/tag. For example..JSON structure requires 'NAME' property under a pagelist structure(e.g. Data.LIST()). But name property already exists in inheritance(like @baseclass). So Pega wizard created "NAME2" property with 'NAME' as pzExternalName qualifier value.

Hi All,

We were getting 'exception occurred while mapping incoming response to .response_get' while calling a REST service(REST service was initially consumed using Pega wizard). As suggested in many articles (like this: https://collaborate.pega.com/question/exception-occured-while-mapping-incoming-response-responseget)- we tried using clipboard property for mapping response and later converting response into json page using 'pxConvertStringToPage' function. We were mapping results in the following way-

Clipboard property->Converted JSON page->Datasource.response_GET

Now this approach is not working for properties for which PEGA OOTB connector wizard create properties with different identifier

Normally Pega creates such properties with qualifier  'pzExternalName' equal to the original JSON attribute/tag. For example..JSON structure requires 'NAME' property under a pagelist structure(e.g. Data.LIST()). But name property already exists in inheritance(like @baseclass). So Pega wizard created "NAME2" property with 'NAME' as pzExternalName qualifier value.

Now when we are converting response from clipboard property to response_GET page...the structure is getting created with exact attribute name like in service response (i.e. "ParsedJSON.Data.LIST(1).NAME"). Now when we are mapping the entire top level 'ParsedJSON.Data' to 'response_GET.Data', Pega is expecting 'NAME2' property under 'response_GET.Data.List()' whereas  'ParsedJSON.Data.List()' has 'NAME' property. So the mapping gets skipped.

How to handle this issue?

-Withdrawing property ('NAME') in higher inheritance is not an option since it is used in other services in our application

-Mapping properties individually is not an option as 'ParsedJSON' is class-less and source pagelist(ParsedJSON.Data.List()) cannot be defined- throwing error in service response DT

***Edited by Moderator: Pooja to add platform capability tags***
Pega Platform 8.2.2 Data Integration Low-Code App Development