Dependent Date Shift¶
See Dependent Date Shift for more information about this algorithm framework.
Creating a Dependent Date Shift Algorithm via API¶
-
Retrieve the frameworkId for the Dependent Date Shift Framework. This information can be retrieved using the following endpoint:
algorithm GET /algorithm/frameworks
The framework information should look similar to the following:
{ "frameworkId": 3, "frameworkName": "Dependent Date Shift", "frameworkType" : "GENERIC_DATA_ROW", "plugin" : { "pluginId" : 7, "pluginName" : "dlpx-core" } }
-
Create a Dependent Date Shift algorithm via the following endpoint:
algorithm POST /algorithms
Configure a new algorithm using the JSON formatted input similar to the following:
{ "algorithmName": "DependentDateShiftTest", "algorithmType": "COMPONENT", "createdBy": "admin", "description": "Test of the DependentDateShiftAlgo", "frameworkId": 3, "pluginId": 7, "fields": [ { "fieldId": 1, "name": "date1", "type": "LOCAL_DATE_TIME" }, { "fieldId": 2, "name": "date2", "type": "LOCAL_DATE_TIME" } ], "algorithmExtension": { "roll": false, "unit": "DAYS", "maxRange": 5, "minRange": 3, "intervalRange": 2 } }
Dependent Date Shift Algorithm Extension¶
- minRange
Integer
This number represents the smallest number of time units that will be added to date1 when masking. The range is inclusive of this value. Negative values represent units of time in the past and positive values represent units of time in the future. If date1 is not provided, this is applied to date2. - maxRange
Integer
This number represents the largest number of time units that will be added to date1 when masking. The range is inclusive of this value. Negative values represent units of time in the past and positive values represent units of time in the future. If date1 is not provided, this is applied to date2. - unit (default="DAYS")
String
A unit of time that the range is expressed in. This unit is also used to determine the interval between date1 and date2. Supported units include years, months, days, hours, minutes, and seconds. - roll (default="false")
String
A boolean that represents whether or not the specified time unit should roll which means that units of time larger and smaller than the specified unit will remain the same. When set to false, there is no guarantee that larger units of time remain the same. Option only supported for months, days, hours, minutes, and seconds. This applies when masking date1. If date1 is not provided, this is applied to date2 - intervalRange
Integer
A number representing the +/- range value to shift the interval inclusive of the range value. A value of 0 will not change the interval between dates. This number may not be less than 0. If the specified unit difference between date1 and date2 is within the bound of the intervalRange, only values will be provided such that the sign of the difference is preserved. For example, if the day difference between date1 and date2 is 2 and the specified intervalRange is 3, only values greater than -2 will be used (i.e.: -1 to 3). Otherwise, the full range of values will be used (i.e.: -3 to 3).