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****
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