Skip to main content
Skip table of contents

Numeric expression

See Numeric Expression for more information about this algorithm framework.

Creating a numeric expression algorithm via API

  1. Retrieve the frameworkIdfor the Numeric Expression Framework. This information can be retrieved using the following endpoint:

    CODE
    algorithm       GET /algorithm/frameworks

    The framework information should look similar to the following:

    CODE
    {
        "frameworkId": 26,
        "frameworkName": "Numeric Expression",
        "frameworkType": "BIG_DECIMAL",
        "description": "Numeric Expression masks input by ... [truncated for brevity].",
        "plugin": {
            "pluginId": 7,
            "pluginName": "dlpx-core",
            "pluginAuthor": "Delphix Engineering",
            "pluginType": "EXTENDED_ALGORITHM"
        }
    }
  2. Create a Numeric Expression algorithm instance via the following endpoint:

    CODE
    algorithm   POST /algorithms

    Configure a new algorithm using the JSON formatted input similar to the following:

    CODE
    {
        "algorithmName": "NumericExpressionTest",
        "algorithmType": "COMPONENT",
        "frameworkId": 26,
        "algorithmExtension": {
            "expression": "Math.floor(((input * randomPercentage) * 100.0) + 0.5) / 100.0",
            "inputType": "DOUBLE",
            "constants": [
                {
                    "name": "randomPercentage",
                    "value": "new java.util.Random(seed).doubles(0.1, 0.9).iterator().nextDouble()"
                }
            ],
            "nonConformingDataDefaultValue": "100.0"
        }
    }

Numeric expression algorithm extension

  • expression

String One-line mathematical expression written in the Java programming language that references input (the current unmasked value), e.g. input * 0.5 or input + Math.random().

  • inputType

String ENUM(DOUBLE, LONG, BIG_DECIMAL) Data type that input conforms to within the expression. DOUBLE (default) is double-precision floating point, LONG is long integer, and BIG_DECIMAL is java.math.BigDecimal object.

  • constants(optional)

array[Constant] An array of Constant objects. Constants are variables that the expression can reference by name and whose values remain fixed for the life of a masking job. Constants can reference by name other constants defined before them.

  • nonConformingDataDefaultValue(optional)

String Default masked value to be used if the unmasked input is not a numeric data type and can't automatically be converted to one.

Constant

  • name

String Must be valid Java variable name. No two constants can have the same name, nor can "input" or "seed" be used as a constant name.

  • value

String One-line Java expression that must return a value, which is not required to be numeric.

JavaScript errors detected

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

If this problem persists, please contact our support.