Check for null values
- Last Updated: June 28, 2022
- 2 minute read
- Corticon
- Version 7.2
- Documentation
You can specify a condition that checks for null in attribute values.
Null means that no value has been provided for the attribute in the input data. Null is
different from the value 0 which has significance in mathematical
calculations, or an empty string that does not contain any characters, but is still
treated as a value.
Check for a null value when you want to define a rule that assigns a default value if the value is null. You can also send back information in the response rule message if the value received is null.
You check for a null value by specifying null without any quotes in the condition expression, as shown in this image.
When you create an attribute, you can specify whether the attribute value is mandatory or a null value is acceptable. If you attempt to define a condition that checks for null when the attribute value is mandatory, you see a warning message.
Nulls in Ruletests
If you have to check for null in a rule condition, you must also understand how to specify null in Ruletests because you may want to test the rule using the Ruletest.
By default when you drag and drop an entity into the Input pane in the Ruletest editor, all the attributes in the entity are null. If you double-click a String attribute, the attribute value changes from null to an empty string (denoted by empty square brackets) even if you do not type anything.
To ensure that the attribute value is null, right-click the attribute and select Set to Null: