Configuring Mapping

You can configure input and output mapping for cleanse functions.

The mapping section of cleanseConfig contains information about the common input and output mappings for the cleanse functions. These mappings can be used inside the cleanse infos.

Configuring Input Mapping

Input mapping determines the attributes that are collected from an entity of the cleanse function.

Table 1. Input Mapping
Attribute Description
attribute Specifies the URI of an attribute in the entity.
cleanseAttribute Specifies the name of the attribute's value inside CleanseInputs (the key of the Map<String, Object>)
  • If you want to collect nested and sub-attributes together, specify the name of the nested attribute as a prefix in the cleanseAttribute parameter, separated by a dot.
  • In the case of Identifiers.Type and Identifiers.ID (as given in the example above):
    • The key in the Map<String, Object> is Identifiers.
    • The value is Map<String, String>.

Where the key is the Type or ID and the value is an appropriate value.

allValues Specifies whether a single (OV) value or all values of the attributes are passed to the cleanse function.
  • If allValues is equal to true, then the value of the Map<String, Object> is of type List. This may be omitted.
  • The default value is false.
mandatory Specifies whether the value is required for the cleanse function.
  • If the entity has no such value, the entity is not passed to the cleanse function. This may be omitted.
  • The default value is false.
Sample Input Mapping Configuration
{
  "URI": "configuration/entityTypes/HCP",
  "cleanseConfig": {
    "mappings": [
      {
        "URI": "configuration/entityTypes/HCP/cleanseConfig/mappings/Identifiers",
        "inputMapping": [
          {
            "attribute": "configuration/entityTypes/HCP/attributes/Identifiers/attributes/Type",
            "cleanseAttribute": "Identifiers.Type",
            "mandatory": true,
            "allValues": true
          },
          {
            "attribute": "configuration/entityTypes/HCP/attributes/Identifiers/attributes/ID",
            "cleanseAttribute": "Identifiers.ID",
            "mandatory": false,
            "allValues": true
          }
        ]
      }
    ],
    ...
  }
Maximum Attributes Combinations
[
  {
    "cleanseFunction": "Loqate",
    "options": {
      ...
      },
      ...
    "maxAttributesCombinations": 100
  }
]

Configuring Output Mapping

Output mapping determines where the cleansed values must be stored. It has the same structure as input mapping, except that the allValues parameter does not effect the output mapping.

CleanseOutputs structure generated by the cleanse function has the getCleansedAttributes method that returns Map<String, List<String>>.

  • The cleanseAttribute is the key for the Map<String, List<String>>.
  • The list of values List<String> is applied to the attribute inside the entity.
Note: If any mandatory attribute is omitted in the result, the whole result does not get applied. Also, the cleanse is treated as unsuccessful.