Configuring a Different Direct+ Service
By default, deployment of STEP's Dun & Bradstreet (D&B) component model will create all required configurations for matching and enriching with the Company Profile with Executives, Linkage and Financials (CMPELF) product. However, if CMPELF is not the product request you are interested in, the configurations can be updated to request a different D&B product, such as CMPSRA (Company Profile for Supplier Risk Assessment). To configure any other product requests other than CMPELF, follow the instructions below.
Any additional data model updates to account for data outside of CMPELF must be done manually. For additional information on how to map additional data fields, refer to the Configuring Data Blocks topic.
Operation Configuration
Create a new operation configuration and select the relevant D&B product from the dropdown list. Additional licenses may be required to receive other D&B products. Populate the integration & JSON attribute parameters on the operation configuration.
This is an example of the CMPSRA product.
Enrichment Wrappers and Request Rule
Create two new business rules, one for the request rule and another for the wrapper.
Pictured below is a JavaScript example for request and wrapper:
Request
dnbIntegrationContext.performDefaultEnrichingValidation(currentObject);
if (dnbIntegrationContext.getIntegrationResult().getIntegrationException()) {
return;
}
queryParams = new java.util.HashMap();
queryParams.put("productId", "cmpsra"); //Company Profile for Supplier Risk Assessment
queryParams.put("versionId", "v1");
var dnbOrg = currentObject.getDnbOrganization();
const dunsNumberSingleValue = dnbOrg.getValue("DnBDUNSNumber");
var dunsNumber = dunsNumberSingleValue.getValue();
for(i=dunsNumber.length(); i<9; i++) {
dunsNumber = "0" + dunsNumber;
}
//Using this D&BEnrichConfigDataBlocks config to set integration status attributes, even though 'D&B Product' is set to 'Analytics Assessment Material Change (aasmcu)' The 'D&B Product' setting is not used.
var operationConfiguration = currentObject.getManager().getHome(com.stibo.core.domain.setupentity.SetupEntityHome).getSetupEntityByID('DnBEnrichCMPSRA'); //enrichOperationConfigurationID);
var get = dnbGateway.rest().get();
get.path("/v1/data/duns/" + dunsNumber);
get.pathQuery(queryParams);
get.header("Content-Type", "application/json");
dnbIntegrationContext.setOperationConfiguration(operationConfiguration);
jsonResult = get.invoke();
//Save the JSON
dnbOrg.setSimpleValue(DnBJSONCMPSRA, jsonResult);
//Default built-in enrichment data mapping
dnbIntegrationContext.performDefaultEnrichingDataMapping(currentObject, jsonResult);
var responseObject = JSON.parse(jsonResult);
//TODO: Save additional data from responseObject.organization in Step
Wrapper
var dnbResultCMPSRA = dnbManager.executeBusinessActionWithDnbIntegrationContext(dnbEnrichRequestCMPSRA);
if (dnbResultCMPSRA.getIntegrationException()) {
dataIssuesReport.addError(dnbResultCMPSRA.getIntegrationException().getMessage(), currentObject, enrichIntegrationStatusAttributeCMPSRA);
}
return dataIssuesReport;