Support Article
Cannot modify Parse Normalize rules when performing rule Save As
SA-83824
Summary
Unable to modify the Parse Normalize rules when performing a Save As of the rule.
Error Messages
Not Applicable
Steps to Reproduce
- Save As an existing or create a new Parse Normalize rule.
- Add rows.
- Select the 'Whole Word and Ignore Case' and 'Text to Replace With' checkboxes.
- Check-In the rule.
Root Cause
In the earlier versions of the application, the Normalize rules had the two below properties in the Clipboard:
- pyReplaceList
- pySearchList
In the Clipboard, both the pyReplaceList and the pySearchList contain the same values.
When a Normalize rule is opened, the pyOpenUIDefaults activity is invoked. The pyOpenUIDefaults activity contains a JAVA step.
The activity is executed as below:
The activity checks if pySearchString is present in the Clipboard. If it is present, then the values in pySearchString are iterated and appended to the pyReplacelist property.
Since the pyReplaceList property already contains the same values, appending the pySearchList values to pyReplaceList values duplicates the entries. Hence, duplicate entries display in the UI.
The Clipboard structure is changed in the newer versions of the Pega application.
In the new Clipboard structure, the pySearchlist is absent in the Clipboard properties list.
Since there is a check in the pyOpenUIdefaults activity for the pySearchList, the pySearchList is checked if it is null (present). If the pySearchList is null, the entire activity execution is skipped. Hence, the appending of values to pyReplaceList is skipped. Since pyReplaceList already contains the required values on the Clipboard, Normalize rules are not duplicated and are displayed as required.
Resolution
Perform the following local-change:
Include the below Validation condition (If condition) in the pyopenUIDefaults activity:
Iterator iter = pySearchList.iterator();
ClipboardProperty pyReplaceList = cp.getIfPresent("pyReplaceList");
// SR-D26322-start
if(pyReplaceList==null){
// SR-D26322-end
ClipboardPage rowDataPage = null;
String searchString = "";
while(iter.hasNext()) {
ClipboardProperty sourceRowData = (ClipboardProperty) iter.next();
rowDataPage = pyReplaceList.getPageValue(ClipboardProperty.LIST_APPEND);
searchString = sourceRowData.getStringValue();
rowDataPage.putString("pxObjClass", "Embed-Pega-SearchAndReplace");
rowDataPage.putString("pySearchString", searchString);
rowDataPage.putString("pyWholeWordOnly", wholeWordsOnlyElem);
rowDataPage.putString("pyCaseInsensitive", ignoreCaseElem);
rowDataPage.putString("pyReplaceString", replacementStringElem);
}
// SR-D26322-start
}
// SR-D26322-end
}
Published August 17, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.