Question
Last activity: 12 Aug 2018 16:48 EDT
pyRequestData Param data in Connect-rest
Hi ,
How can we print pyRequestData (Which Contains JSON Request) in Connect-Rest invocation ? If i use Param.pyRequestData , nothing is logged .
Attached is the screen for reference .
Appreciate you response .
Thanks.


Pegasystems Inc.
IN
Thanks , but if we need to do in in our activity , is there any way we can capture from Param page ?
P.S : Making this to debug also works - Rule_Obj_Activity.pyInvokeRESTConnector.Rule_Connect_REST.Action
Did you try as below in java step?
String request= tools.getParamValue("pyRequestData");
oLog.infoForced(request);
its not working , attched is the cdoe and tracer screen
Hi Adithya,
Please see this post https://community1.pega.com/community/product-support/question/how-do-you-get-raw-json-clipboard-conversion
I had exactly the same issue as yourself and I implemented the function the post refers to and it works.
Cheers
Craig
Thanks Craig , so we cannot directly use pyRequestData paramater ? only way is to write a function as in the link you provided


Incessant Technologies
AU
Hi,
If you need in a JSON format, you can use the function @pxConvertPageToString(tools,Primary,json).
Thanks
Surya
Accepted Solution
after connect rest method , below java code can be inserted to print the request in JSON.
ParameterPage TestPP = tools.getParameterPage();
java.util.HashMap TestreqMessageData = new java.util.HashMap();
TestreqMessageData = (java.util.HashMap) TestPP.getObject("pyRequestData");
Iterator it = TestreqMessageData.entrySet().iterator();
while (it.hasNext())
{
Map.Entry pair = (Map.Entry)it.next();
String strReqJSON = (String) pair.getValue();
oLog.infoForced("Connect-Rest Request is : "+strReqJSON);
}
Hi,
I hope you want print request data in log file. please enable debug level logging in below class to get that.
com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector