How to: Configure whether the user-defined parameter value is also a multiple of a specific number¶
For increased granularity, you can configure whether the parameter value is also a multiple of a specific number. This is useful when you wish to limit the input to specific values. The following example configures a parameter that accepts values in the range of 0 to 10 and are only multiples of 3. This means that the accepted values are 3, 6 and 9. Any other value will trigger the VIOL_PARAMETER_NUMERIC_VALUE
violation.
{
"policy": {
"name": "user_defined_parameters_data_types",
"template": {
"name": "POLICY_TEMPLATE_RATING_BASED"
},
"applicationLanguage": "utf-8",
"enforcementMode": "blocking",
"blocking-settings": {
"violations": [
{
"name": "VIOL_PARAMETER_NUMERIC_VALUE",
"alarm": true,
"block": true
},
{
"name": "VIOL_PARAMETER_VALUE_LENGTH",
"alarm": true,
"block": true
},
{
"name": "VIOL_PARAMETER_STATIC_VALUE",
"alarm": true,
"block": true
},
{
"name": "VIOL_PARAMETER_DATA_TYPE",
"alarm": true,
"block": true
}
]
},
"parameters": [
{
"name": "multiples",
"type": "explicit",
"parameterLocation": "any",
"mandatory": false,
"allowEmptyValue": false,
"allowRepeatedParameterName": false,
"sensitiveParameter": false,
"valueType": "user-input",
"dataType": "integer",
"checkMinValue": true,
"checkMaxValue": true,
"minimumValue": 0,
"maximumValue": 10,
"checkMultipleOfValue": true,
"multipleOf": 3
}
]
}
}