Rule specification assets > Rule specification configuration > Dictionaries
  

Dictionaries

A dictionary is a data set that contains one or more columns of reference data. You can specify a dictionary in a rule statement condition or action in basic mode or in expression logic in advanced mode. For example, add a dictionary to a rule statement condition or an IF statement to verify that the input data contains the data values that you expect. Add a dictionary to rule statement action or a THEN statement to return a value that corresponds to the input data value.
A dictionary might contain public terms, such as telephone area codes or address abbreviations. Or, a dictionary might contain values that are specific to an organization, such as employee codes or product codes.
At least one dictionary column must contain a set of standard or required values as defined by a business rule. The other columns can contain alternative versions of the values. The column that contains the correct or required values is called the valid column. By default, the first or left-most column in a dictionary is the valid column. You can populate a dictionary with any combination of values that suits your business rule logic. The data in each column does not need to be formally correct.
When you add a dictionary to a condition or IF statement, the rule specification compares the input data to the values in each column in the dictionary and passes the results to the action in the rule statement.
When you add a dictionary to an action or THEN statement, the rule specification compares the input data to the values in each column in the dictionary and returns a value according to the operation that you define. For example, the action might return the value in the valid column on the same row in the dictionary.
Note: In a search and replace operation, a rule specification searches every column in the dictionary except the valid column that the asset specifies. If you want the search operation to include the valid column data, add a copy of the valid column to the dictionary. By default, the valid column is the first or left-most column in a dictionary. You can create a dictionary that contains two identical columns of data.
You can change the valid column that an action uses in the Define Actions dialog box in basic mode. To change the valid column that you use in advanced mode, add the column name when you identify the dictionary in the rule logic.
You can use any dictionary in a condition regardless of the number of columns that the dictionary contains. Some of the dictionary options in the Define Actions dialog box require a dictionary with two or more columns.

Dictionary example

The following table contains rows from a dictionary of city names in India:
Name1
Name2
Mumbai
Bombay
Chennai
Madras
Bengaluru
Bangalore
Puducherry
Pondicherry
Kadapa
Cuddapah
Kochi
Cochin
Kolkata
Calcutta
The Name1 column contains the current names of cities in India. The Name2 column contains the previous version of each city name. You might use the dictionary in an action to replace the older city names with the current city names.
You might also create a dictionary with a single column of data that contains the older city names. You can use the dictionary in a condition to determine if an input data set contains the older names.