Question

2
Replies
648
Views
Dileep Kumar (DileepK5330)
Morgan Stanley UK Group

Morgan Stanley UK Group
IN
DileepK5330 Member since 2017 3 posts
Morgan Stanley UK Group
Posted: June 5, 2019
Last activity: June 6, 2019
Posted: 5 Jun 2019 10:58 EDT
Last activity: 6 Jun 2019 8:40 EDT
Closed

where will get the details of this function "pega.getServiceUtilsPriv()"

Hi,


we are facing some issue in integration, so on debugging the issue we found below code in OOTB activity, so wanted to understand the function behavior of "pega.getServiceUtilsPriv()" in below code-



final com.pega.pegarules.priv.util.ServiceUtilsPriv svcUtilPriv = pega.getServiceUtilsPriv();

final ClipboardPage stepPage = tools.getStepPage();

final ParameterPage pp = tools.getParameterPage();

final ServiceUtils svcUtil = tools.getServiceUtils();



final String DEFAULT_ENCODING = "UTF-8";


// final java.util.Map resourceParamValsMap = (java.util.Map) pp.getObject("pyResourceParameters");


try

{

String serviceURL = svcUtilPriv.getStringIndirect(stepPage, "pyResourcePath");

final String overrideSvcURLWithThis = tools.getParamValue("EndPointURL");

if (overrideSvcURLWithThis != null && overrideSvcURLWithThis.trim().length() > 0)

{

serviceURL = overrideSvcURLWithThis;

}


if (serviceURL == null || serviceURL.trim().length() < 1)

{

final String val = "Fail:Missing";

final String msg = "service URL was not provided";

oLog.error(msg);

pp.putString("pyStatusVal", val);

pp.putString("pyStatusMsg", msg);

throw new ConnectorException(msg, handlerFlow);

}

Hi,

we are facing some issue in integration, so on debugging the issue we found below code in OOTB activity, so wanted to understand the function behavior of "pega.getServiceUtilsPriv()" in below code-

final com.pega.pegarules.priv.util.ServiceUtilsPriv svcUtilPriv = pega.getServiceUtilsPriv();
final ClipboardPage stepPage = tools.getStepPage();
final ParameterPage pp = tools.getParameterPage();
final ServiceUtils svcUtil = tools.getServiceUtils();

final String DEFAULT_ENCODING = "UTF-8";

// final java.util.Map resourceParamValsMap = (java.util.Map) pp.getObject("pyResourceParameters");

try
{
String serviceURL = svcUtilPriv.getStringIndirect(stepPage, "pyResourcePath");
final String overrideSvcURLWithThis = tools.getParamValue("EndPointURL");
if (overrideSvcURLWithThis != null && overrideSvcURLWithThis.trim().length() > 0)
{
serviceURL = overrideSvcURLWithThis;
}

if (serviceURL == null || serviceURL.trim().length() < 1)
{
final String val = "Fail:Missing";
final String msg = "service URL was not provided";
oLog.error(msg);
pp.putString("pyStatusVal", val);
pp.putString("pyStatusMsg", msg);
throw new ConnectorException(msg, handlerFlow);
}

mainURLBuilder = new StringBuilder(serviceURL);
}
catch (ConnectorException ce)
{
// handles inbound and outbound mapping exceptions...
throw ce;
}
catch (Exception e)
{
// need to wrap this in a ConnectorException
String val = "Fail:InternalReason";
String msg = "Caught unhandled exception while getting Service URL: " + e.toString();
oLog.error(msg, e);
pp.putString("pyStatusVal", val);
pp.putString("pyStatusMsg", msg);

throw new ConnectorException(msg, handlerFlow, e);

}
finally
{
LogContext.pop();

//Sanity check of stopping detail timers
if (svcUtil.stopConnectOutMapReqTimeStat())
{
oLog.warn("oConnectOutMapReqTime timer stopped in finally block, timer will not be accurate");
}

if (svcUtil.stopConnectClientResponseElapsedStat())
{
oLog.warn("oConnectClientResponseElapsed timer stopped in finally block, timer will not be accurate");
}

if (svcUtil.stopConnectInMapReqTimeStat())
{
oLog.warn("oConnectInMapReqTime timer stopped in finally block, timer will not be accurate");
}
}

Data Integration
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.