Pattern Based Cleanser

The pattern based cleanser generates the output text as defined and adds an attribute to the ReltioCleanser crosswalk.

Cleanser Name - PatternBasedFieldBuilder

Description - This cleanser generates the output text as defined and adds an attribute to the ReltioCleanser crosswalk, as per the output mapping.

Table 1. Options
Key Allowed Sub-Attribute Name
isForce Boolean (true/false)
  • True - always generates a value for the Output Text attribute, whether or not the data for the desired output is supplied in the request.
  • False - generates value if the Output Text attribute is not available or blank.
  • The default value is False.
pattern This is the only pattern to generate the desired output. The output is generated as per the given pattern only. If no pattern is defined, the input values are arranged with spaces in between.

Limitation - When you have defined a cleanse input name of your own, for the desired output attribute, instead of OutputText, the cleansing option isForce is not applicable.

L3 Configuration - Map the PatternBasedFieldBuilder for any entity in your L3 configuration. Here is an example of a sample configuration:

{
  "uri": "configuration/entityTypes/HCP2",
  "cleanseConfig": {
    "infos": [
      {
        "uri": "configuration/entityTypes/HCP2/cleanse/infos/PatternBasedFieldBuilder",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "PatternBasedFieldBuilder",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Name",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Name"
                    },
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Organization",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Organization"
                    },
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Country",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Country"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/ShortNote",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "isForce": true,
                  "pattern": "{Name}, {Organization} - {Country}"
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "attributes": [
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Name",
      "label": "Name",
      "name": "Name",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Country",
      "label": "Country",
      "name": "Country",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Organization",
      "label": "Organization",
      "name": "Description",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/ShortNote",
      "label": "ShortNote",
      "name": "ShortNote",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    }
  ]
}

Example

Table 2. Example
Options Inputs (InputText) Output (OutputText)

{ “isForce: false,
   “pattern”: I, “{FirstName} {LastName}, live in {Country}”
}
{
"FirstName": "Walter",
"LastName": "Bruce"
"Country": "USA"
}
{
"FirstName": "Walter",
"LastName": "Bruce"
"Country": "USA"
"OutputText":"I, Walter Bruce, live in USA"
}
{ “isForce: false,
   “pattern”: “{Address1}, {City}, <br>{Country} - {PostalCode}”
}
{
"Address1": "100 MAIN ST
",
"City": "SEATTLE WA
",
"Country": "USA
",
"PostalCode": "98104
"
}
{
"Address1": "100 MAIN ST",
"City": "SEATTLE WA",
"Country": "USA",
"PostalCode": "98104"
"OutputText":"100 MAIN ST, SEATTLE WA, <br>USA - 98104"
}