Whenever we’ve written a condition so far, it’s been translated to a search for any object (or group of objects) that matches the condition in the working memory. If we precede the condition of an object (or group) with the not keyword, we can check whether no incidence of the condition is found in the working memory and trigger a rule for these cases. Let’s see the following example of this keyword:

rule "warn about empty working memory"
    when
           not(Order() or Item())
    then
           ... //we don't have Orders nor Items
end

Another way of writing this rule would be as follows:

rule "warn about empty working memory"
    when
           not(Order())
           not(Item())
    then
           ... //we don't have Orders nor Items
 end