Configure Predefined Data Quality Rules to Process Link Requests in Application Composer
The configuration of Groovy Script for linking is done in Application Composer using the standard Unified Sandbox framework for developing and testing your scripts.
We recommend that you create a separate, dedicated sandbox for linking rather than combine this configuration with other types of Application Composer configuration activities. This approach gives you the greatest flexibility for design and deployment of your linking configuration.
- The record with the highest Customer Profile Quality Score should be selected as the main record.
- If multiple records are tied for the highest Customer Profile Quality Score, use the most recently updated record as the tiebreaker.
- If none of the records in the link request have been assigned a Customer Profile Quality Score, take whatever record had been designated as main by the upstream process.
To create an Application Composer Sandbox:
- Click .
- Click Create Sandbox.
- Specify a name and select Application Composer under All Tools. Also select the Publishable option as Yes.
- Click Create and Enter.
- Click the Application Composer icon.
- Go to Common Setup and click Data Quality Rules.
- Click the AccountSetMainLink template.
- Copy and paste the code given in Sample Code section in the Edit Data Quality Rules page.
- Click Save and Close.
Deploy the code. See the topic: Deploy the Link Request Configuration.
What the sample script does
The script begins by calling the getRows() input function which returns all the Parties selected in the link request.
The script loops through the records in the resolution request to inspect each record’s Customer Profile Quality Score value. Each record’s value is compared to the highest value found so far, and if the current row has a higher value than the highest value found so far, that row is promoted to become the master record of the link set.
Finally, the script calls the selectMaster() output function to designate the main record. If a top-priority or second-priority record was identified earlier in the script, that record is provided to the selectMaster() function. If no priority record was identified, then the default master record specified by the upstream process will be retained as the master record for the resolution request.
Sample Script:
try {
def requestRows = getRows();
def rowMaster = false;
def rowDefaultMaster = getMaster();
def iHighestAccountScore = 0;
for (row in requestRows)
{
if (nvl(row.getAttribute("ProfileQualityScore"), 0) > iHighestAccountScore) {
rowMaster = row;
iHighestAccountScore = row.getAttribute("ProfileQualityScore");
}
}
if (rowMaster) {
selectMaster(rowMaster);
} else {
selectMaster(rowDefaultMaster);
}
} catch (Exception e) {
def sMsg = "Exception in Account Set Master: " + e.getMessage();
println(sMsg);
}