Question

2
Replies
513
Views
DileepK5330 Member since 2017 3 posts
Morgan Stanley UK Group
Posted: 1 year ago
Last activity: 1 year 3 months ago
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);
}

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
Share this page LinkedIn