Numeric expression
See Numeric Expression for more information about this algorithm framework.
Creating a numeric expression algorithm via API
Retrieve the frameworkIdfor the Numeric Expression Framework. This information can be retrieved using the following endpoint:
CODEalgorithm 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" } }
Create a Numeric Expression algorithm instance via the following endpoint:
CODEalgorithm 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
orinput + 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, andBIG_DECIMAL
isjava.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.