Any null value encountered by a targeter is interpreted to mean “this value is unknown.” If any such unknown values are encountered during rule evaluation or query execution, the corresponding repository items are not included in the targeting results. For example, consider the rule

<rule op=eq>
  <valueof bean="Profile.ageGroup">
  <valueof target="ageGroup">
</rule>

This rule might encounter null values in two cases:

The less intuitive case is the case with rules that use negative rule operators, such as neq. For example:

<rule op=neq>
  <valueof bean="Profile.ageGroup">
  <valueof target="forbiddenAgeGroup">
</rule>

Here again,

The principle behind this treatment of null values is that when the user doesn’t specify a value for one of his properties, or when the content creator does not specify a value for one of the content attributes, that unspecified value in actuality may or may not match the rule condition we are trying to satisfy. If there is a possibility that the condition may not be satisfied, we always err on the conservative side and do not include the questionable people or content. If you want to include items with null values, then add a term to the rule with an or rule operator, like this:

<rule op=or>
  <rule op=eq>
    <valueof bean="Profile.ageGroup">
    <valueof target="ageGroup">
  </rule>
  <rule op=isNull>
    <valueof target="ageGroup">
  </rule>
</rule>

This rule returns all content items whose ageGroup attribute matches the profile’s ageGroup, and also all content items whose ageGroup attribute is null.

 
loading table of contents...