KYC Framework - Response Property control - > intention for _Master properties
We're on KYC 7.12 and Pega 7.18. There are 2 UI controls for displaying the KYC question: KYCItem and PropRefKYCItem. In both of them, there is a block such as below.
What the block does (at least what I understand it to do) is:
1 - Check if the response property a reference property (can be indirectly set a value of another property) and if yes
2 - Iterate over all properties of all KYCType pages
3 - attempt to find property of same name as <response property>_Master
4 - if found, set current property the value of that _Master property
We're on KYC 7.12 and Pega 7.18. There are 2 UI controls for displaying the KYC question: KYCItem and PropRefKYCItem. In both of them, there is a block such as below.
What the block does (at least what I understand it to do) is:
1 - Check if the response property a reference property (can be indirectly set a value of another property) and if yes
2 - Iterate over all properties of all KYCType pages
3 - attempt to find property of same name as <response property>_Master
4 - if found, set current property the value of that _Master property
String respPropRef = topPageRef;
respPropRef = respPropRef + strRefPageName;
respPropRef = respPropRef + respPropName.getStringValue();
ClipboardProperty respProp = tools.getProperty(respPropRef);
if ((respProp != null) && (respProp.isDefinedAsReference()) && (!respProp.hasReference())) {
//Look for its master and link to it
ClipboardProperty kycTypesProp = tools.getProperty(topPageRef + ".KYCTypes");
//ClipboardPage kycTypesPage = tools.findPage("pyWorkPage.KYCTypes(1)");
boolean masterFound = false;
for (int pgListIdx = 1; pgListIdx <= kycTypesProp.size(); pgListIdx++) {
ClipboardPage kycTypesPage = kycTypesProp.getPropertyValue(pgListIdx).getPageValue();
java.util.Collection props = kycTypesPage.values();
Iterator iter = props.iterator();
// Look for the Master of this property and link to it.
ClipboardProperty candidateMasterProp;
String candidateName;
while (iter.hasNext()) {
// Link the Reference to the Master.
candidateMasterProp = (ClipboardProperty) iter.next();
candidateName = candidateMasterProp.getName();
if (candidateName.endsWith("_Master")) {
String[] masterName = candidateName.split("_", 2);
if (masterName[0].equals(respPropName.getStringValue().substring(1))) {
// Link the Reference to the Master.
respProp.setAsReference(tools.getThread(), candidateMasterProp);
masterFound = true;
break;
}
}
} //End of While Loop
if (masterFound)
break;
} // End of For Loop
} // End of isDefinedAsReference if statement
I could understand the purpose behind property references, however from KYC point of view, each country kyc type would have different properties, or if not different properties, would have different values. If there are other kyc types, the data should be present already in said kyc types, and would not make sense from both business and technical purpose to display the same piece of information on the 2+ distinct KYC types.
Can someone from KYC product background please explain what the intended purpose of this check was? What was the business or technical use case which prompted this logic to be included?
***Moderator Edit: Vidyaranjan | Updated Categories***