Question
RulesCube
PE
Last activity: 30 Jan 2019 15:25 EST
SLA doesn't localize correspondence 7.3.1
Hi,
I need some support about how to localize a correspondence rule for a sla.
I have a base correspondence rule in english "CorrTest" in a ruleset ( example: ccla ) and the same rule with translated content in spanish in the localize ruleset ( ccla_es ).
According to the sla i run an activity that calls "CorrSend" but it only send the email with the contents of the rule that is in english.
At runtime the localization works fine it searchs the contents of the ruleset from the user language preferences.
I read other post about the pxRequestor page and tried to change the .pxReqLocale property manually but also that didn't work.
I will upload the activity that send the email.
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Areteans
IN
Hi,
Any queue processing will never have the localization. You need some customization for sending localized mails/sms.
In your SLA put some activity which will initialize the requestor locale.
Like below.
-----------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";// this is for US english, you can put your locale
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Hi,
Any queue processing will never have the localization. You need some customization for sending localized mails/sms.
In your SLA put some activity which will initialize the requestor locale.
Like below.
-----------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";// this is for US english, you can put your locale
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Then get the Corr value using property-set-corr and then do the processing.
else you can use this whole code in a function as well which will take the input as corr name and output as corr text .
--------------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
//Map the correspondence related properties here and name from parameter
StringMap keys = new HashStringMap();
keys.putString("pxObjClass", "Rule-Obj-Corr");
keys.putString("pyStreamName",TEMPLATENAME);//ur corr name goes here
keys.putString("pyClassName",Corr class name);
keys.putString("pyCorrType", "");corr type like PhoneText/Email etc
SMSText=tools.getStream(keys, null);
return SMSText;
-------------------------------------------------------------------------------------------------------------------------------------------
Thanks
Kamalesh
Tech Mahindra Ltd
CA
Can you print the pxRequestor.pxReqLocale property value in the log and confirm if the value is diffrent than "en_US" ? Also note that the SLA agent ( Pega-ProCom :ServiceLevelEvents) is a standard agent.For standard agents, each queue item is processed in the authorization context of the user whose actions or processing (work item, assignment, and so on) generated the queue item.So you need to check the locale value of the user who had added the SLA item in the firstplace.
RulesCube
PE
I added a log at the beginning of the activity. The pxRequestor.pxReqLocale is empty and this is the queue xml:
<?xml version="1.0"?>
I added a log at the beginning of the activity. The pxRequestor.pxReqLocale is empty and this is the queue xml:
<?xml version="1.0"?>
<pagedata>
<pyAttempts>1</pyAttempts>
<pxTaskName>Assignment1</pxTaskName>
<pxUpdateSystemID>7a551d756ff09a4efea8971b71ee1ae6</pxUpdateSystemID>
<pyItemId>SYSTEM-QUEUE-SERVICELEVEL 15487951857100007A551D756FF09A4EFEA8971B71EE1AE6</pyItemId>
<pyPriority>0</pyPriority>
<pxLastExecutionDateTime>20190129T205305.710 GMT</pxLastExecutionDateTime>
<pxAssignmentClass>Assign-Worklist</pxAssignmentClass>
<pxCreateDateTime>20190129T205305.710 GMT</pxCreateDateTime>
<pxAssignmentHandle>ASSIGN-WORKLIST BNS-IB-CCLA-PE-WORK-SCM PCCS-17260!FULFILLMENT_FLOW</pxAssignmentHandle>
<pyMinimumDateTimeForProcessing>20190129T205405.629 GMT</pyMinimumDateTimeForProcessing>
<pyUseApplications>true</pyUseApplications>
<pyItemStatus>Scheduled</pyItemStatus>
<pxUpdateSystemNode>lvappi02047.cloud.bns</pxUpdateSystemNode>
<pxInsName>SYSTEM-QUEUE-SERVICELEVEL 15487951857100007A551D756FF09A4EFEA8971B71EE1AE6</pxInsName>
<pxSaveDateTime>20190129T205305.710 GMT</pxSaveDateTime>
<pyAccessGroup>CCPE:SBPS</pyAccessGroup>
<pyAgentName>Pega-ProCom:ServiceLevelEvents</pyAgentName>
<pyMinimumAgeForProcessing>-1</pyMinimumAgeForProcessing>
<pzInsKey>SYSTEM-QUEUE-SERVICELEVEL SYSTEM-QUEUE-SERVICELEVEL 15487951857100007A551D756FF09A4EFEA8971B71EE1AE6</pzInsKey>
<pxAssignmentCreateDateTime>20190129T205305.707 GMT</pxAssignmentCreateDateTime>
<pyMaxAttempts>1</pyMaxAttempts>
<pxEvent>Goal</pxEvent>
<pxObjClass>System-Queue-ServiceLevel</pxObjClass>
<pyRetainOnSuccess>false</pyRetainOnSuccess>
<pyRetainOnFailure>true</pyRetainOnFailure>
<pySelectId>15487951857100007A551D756FF09A4EFEA8971B71EE1AE6</pySelectId>
<pzStatus>valid</pzStatus>
<pyRecurrenceDetails>
<pxObjClass>Data-Event-Recurring</pxObjClass>
</pyRecurrenceDetails>
</pagedata>
Accepted Solution
Areteans
IN
Hi,
Any queue processing will never have the localization. You need some customization for sending localized mails/sms.
In your SLA put some activity which will initialize the requestor locale.
Like below.
-----------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";// this is for US english, you can put your locale
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Hi,
Any queue processing will never have the localization. You need some customization for sending localized mails/sms.
In your SLA put some activity which will initialize the requestor locale.
Like below.
-----------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";// this is for US english, you can put your locale
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Then get the Corr value using property-set-corr and then do the processing.
else you can use this whole code in a function as well which will take the input as corr name and output as corr text .
--------------------------------------------------------------------------------------------------------------------------------------------------------
PublicAPI tools = null;
String SMSText="";
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
ClipboardPage pxReqTemp = tools.getStepPage();
String strDefaultLocale = "en_US";
try {
thisThread.setLocaleName(PRThread.LOCALE_DEFAULT, strDefaultLocale);
} catch (InvalidLocaleException ilEx) {
pxReqTemp.addMessage("Invalid Default Locale: " + ilEx.getMessage());
thisThread.getStepStatus().set(ProcessingStatus.SEVERITY_FAIL, "Invalid-Locale", ilEx.getMessage());
}
}
//Map the correspondence related properties here and name from parameter
StringMap keys = new HashStringMap();
keys.putString("pxObjClass", "Rule-Obj-Corr");
keys.putString("pyStreamName",TEMPLATENAME);//ur corr name goes here
keys.putString("pyClassName",Corr class name);
keys.putString("pyCorrType", "");corr type like PhoneText/Email etc
SMSText=tools.getStream(keys, null);
return SMSText;
-------------------------------------------------------------------------------------------------------------------------------------------
Thanks
Kamalesh
RulesCube
PE
Thanks for the response,
I will test the initialization of the requestor locale.