We have a LaunchSupervisorOverride javascript function which

We have a LaunchSupervisorOverride javascript function which takes a string array parameter
overriderreasons[0] = “Supervisor Override is requ….”.
The javascript function that performs the mapping is shown below:
LaunchSupervisorOverride Script (full js at end of doc):
function LaunchSupervisorOverride (SO_endpoint,transitID, applicationID, displayname, overridereasons, messagetypestring,
messagedescriptionstring, operatorID, locale)
{
…
RequestObject={};
RequestObject.refId = new Date().getTime().toString();
RequestObject.displayName = displayname;
RequestObject.overrideReasons = [];
…
for (var i in overridereasons) {
RequestObject.overrideReasons[i]= overridereasons[i];
}
In Pega6.2SP2 we did not find any issue executing the javascript. Request.Object.overrideReasons[0] is
empty (the inability to map the specified text may be a separate issue):
The issue is a difference in behavior for Pega 7.2.1. In this version, the OverriderReasons parameter is
passing as individual characters as below:
Pega7.2.1 (each character is a separate array value):
The question is why the javascript behavior is different between 6.2SP2 and 7.2.1, and if
there is a syntax issue that needs to be made to allow for the entire text value to be mapped
as a string array instance instead of a character array.
SupervisorOverride js file:
/*
This function is responsible for launching the supervisor override. The following parameters are accepted by this function.
Endpoint: Endpoint for SO. See Declare_Portal, node level page for SO_Endpoint property.
TransitID: the transit that the launch is required for (i.e. 01222)
applicationID: application this launch is for (i.e. 67)
Displayname: name to be displayed for the overrideLaunchSupervisorOverride
Override Reasons: reasons for the override (this can be more than one)
MessageType: Represents type of condition message
Message Description: represents description of condition message
Operator ID: The ID of the user logged into Compass
Locale: Language of operator using application. en_CA or fr_CA
Authored: Shezan Chagani
*/
function LaunchSupervisorOverride (SO_endpoint,transitID, applicationID, displayname, overridereasons, messagetypestring,
messagedescriptionstring, operatorID, locale)
{
//alert("Inside the LaunchSupervisorOverride"+messagetypestring+"Message Description :-"+messagedescriptionstring);
var endpoint = SO_endpoint;
var messagetypetemp = ""
var messagedesctemp = ""
var messagetype = messagetypestring.split("$$$");
var messagedesc = messagedescriptionstring.split("$$$");
RequestObject={};
RequestObject.refId = new Date().getTime().toString();
RequestObject.displayName = displayname;
RequestObject.overrideReasons = [];
//alert("messagetype Length"+messagetype.length);
//applicationID="67";
for (var i in overridereasons) {
RequestObject.overrideReasons[i]= overridereasons[i];
}
RequestObject.detailedMessage = false;
RequestObject.messageDetailHeader = {};
RequestObject.messageDetailValue = {};
if (locale=="fr_CA")
{
RequestObject.messageDetailHeader["Type De Message"] = "Description Du Message";
}
else {
RequestObject.messageDetailHeader["Message Type"] = "Message Description";
}
for(var i=0;i< messagetype.length;i++)
{
RequestObject.messageDetailValue[messagetype[i]] = messagedesc[i];
}
var URL =JSON.stringify(RequestObject);
//alert(typeof URL.value);
//endpoint="https://w3sit.eportal.cibc.com:47320/cibc-commons-sso/override?action=start"
//URL = endpoint + "transitID=" + transitID + "&applicationID=" +applicationID + "&operatorID=" + operatorID + "&_locale=" + locale
+ "&data=" + //URL +"&timestamp=" + RequestObject.refId;
URL = endpoint + "&transitID=" + transitID + "&applicationID=" +applicationID + "&operatorID=" + operatorID + "&_locale=" + locale
+ "&data=" + URL;
//alert("URL : "+URL);
openUrlInDialog(URL,400,700,"");
var oSafeURL = new SafeURL("CIBC-Int-Security-.SupervisorOverride");
oSafeURL.put("refId", RequestObject.refId)
var strReturn = httpRequestAsynch(oSafeURL.toURL(),null, 50, 100);
//alert("strReturn"+strReturn);
}