Skip to main content
Skip table of contents

Multi Column Condition (Algorithm frameworks)

The Multi Column Condition framework will mask columns with different algorithms based on the value in a key column. The JSON used to configure the algorithm supports a list of various possible values found in the key column, or conditions. Each condition determines how the other columns referenced by the algorithm are masked.

An instance of the algorithm can reference:

  • One key column to determine the condition used.

  • Ten string columns.

  • Three date columns.

  • Three numeric columns.

  • Three binary columns.

  • One concat column that receives the concatenated value of other columns.

Each of the typed columns declared must have a value that is a valid algorithm. This can be user-created algorithm instances or built-in algorithms. If an invalid algorithm name is given, an error will be shown.

This is an example configuration to assist with information below. Refer to it to observe described keys in a valid configuration.

CODE
{
    "conditions": [
        {
            "key": [
                "FN"
            ],
	        "string1": {
                "name": "dlpx-core:CM Alpha-Numeric"
            }
            "date1": {
                "name": "DateShiftDiscrete"
            }
            "numeric1": {
                "name": "dlpx-core:CM Numeric"
            },
	        "binary1": {
                "name": "NULL SL"
            },
            "ignoreColumns": [
                "string2"
            ]
        },
        {
            "key": [
                "LN"
            ],
            "string1": {
                "name": "Custom String 1 (Example)"
            },
            "string2": {
                "name": "dlpx-core:LastName"
            },
	        "date1": {
                "name": "Custom Date 1 (Example)"
            }
            "numeric1": {
                "name": "Custom Numeric 1 (Example)"
            },
            "binary1": {
                "name": "Custom Binary 1 (Example)"
            },
	        "concat1": {
                "dateFormat": "ddMMyyyy",
                "concatPattern": [
                "<string1>",
                " custom string  ",
                "<string2>"
                ],
                "concatBeforeMasking": false,
                "preserveEmptyValues": true,
                "algoAfterConcatenating": {
                        "name": "dlpx-core:CM Alpha-Numeric"
            }
        }
    ],
    "fallbackKey": "FN",
    "fallbackAlgo": {
        "dateAlgo": null,
        "binaryAlgo": null,
        "stringAlgo": {
            "name": "dlpx-core:CM Alpha-Numeric"
        },
        "numericAlgo": null
    },
    "filterLength": 0,
    "filterDirection": "FIRST",
    "keyCaseSensitive": false
}

Assigning column keys

The conditional key “key“ and each of the typed keys are assigned to a database column in the UI inventory screen as shown below.

  • Conditions [list]
    The conditions key is a list that contains any number of JSON objects. Each object must reference at least one "key" and determine a custom set of algorithms and actions to take for masking columns.

  • Key [list]
    Required for each condition. The list contains any number of strings referencing a possible value in the database column assigned to key for the multi-column condition algorithm. If one of these values are found, the algorithms for this condition will be used.

  • String 1-10 [key/value]
    Each of these keys, expressed as string1 through string10, specify the algorithm that will be applied to a string type column in the database.

  • Numeric 1-3 [key/value]
    Each of these keys, expressed as numeric1 through numeric3, specify the algorithm that will be applied to a numeric type column in the database.

  • Date 1-3 [key/value]
    Each of these keys, expressed as date1 through date3, specify the algorithm that will be applied to a numeric type column in the database.

  • Binary 1-3 [key/value]
    Each of these keys, expressed as binary1 through binary3, specify the algorithm that will be applied to a binary type column in the database.

  • Concat 1 [key/value]
    There is a single optional concatenation column called concat1 available. The row it is assigned to had data inserted formed from the concatenation of other columns in the inventory and string literals. The concatPattern key defines the structure of the output. In the example configuration above, the value of the assigned string1 column will be concatenated with “custom string” and then the value of string2.

    • Other concat parameters:

      • concatBeforeMasking – Whether the source column data should be masked with its respective algorithms before insertion to the concat column.

      • preserveEmptyValues – Whether an empty source column value should be preserved prior to concatenation.

      • algoAfterConcatenation – The algorithm to be applied to the complete concatenated data

      • dateFormat – If a source column is a date, this is the format to use for conversion to string.

  • IgnoreColumns [list]
    This list of columns will be excluded from masking for the parent condition. This takes precedence over all fallback algorithms. Output data will contain the unmasked values for the specified columns with these keys. This cannot be used for a fallback key. Keys that where it is needed implement an ignoreColumns list must be explicitly defined.

Fallbacks

There are three levels of possible fallback algorithms to ensure that data is still masked in unexpected situations. These fallback algorithms are defined outside of the conditions list. They are listed and described below.

  • Fallback Key
    If masking finds a value in the key column that cannot be found in the key list for any defined conditions, this key will be used. The fallback key defined must be found in the key list of a condition. All algorithms for that condition will be applied normally to this row.

  • User-defined Fallbacks
    Outside the list of conditions is the fallbackAlgo key. It is a JSON object with four possible key/value pairs. The keys stringAlgo, numericAlgo, dateAlgo and binaryAlgo may correspond with an algorithm value of the specified data type. If no fallback key is defined, or the algorithms for the fallback key do not describe a given column, these algorithms will be used.

  • Global Fallback
    These are internal to the algorithm. If no fallback key applies and no user defined fallback algorithm for the input type is defined, this algorithm will mask the data. This is the last tier of fallback. If everything else fails these algorithms will be used.

    • The global fallback algorithms by type are:

      • String – dlpx-core:CM Alpha-Numeric

      • Numeric – dlpx-core:CM Numeric

      • Date – DateShiftDiscrete

      • Binary – NullValueLookup

Key filter

Sometimes only a portion of the value in the key column is needed to determine a condition. The filter options allow a subsection of the value to be used.

Filter parameters:

  • filterLength – The number of characters from the key column value to use. If set to zero, the entire value is used.

  • filterDirection – Allowed values "FIRST" and "LAST". Whether the first or last characters of the key column string are preserved according to the filterLength.

  • keyCaseSensitive – Whether character case is considered when matching keys for a condition.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.