How to express one object is null when I use the saliva control mechanism

I want to know how I can express one object, zero on the left side, when I use the drool rule mechanism? And can someone tell me how to use the drools keyword “no” and so on. Thanks!

+4
source share
2 answers

You can call notin whento check for null objects:

rule "somerule"
    no-loop
    when not AnObject()
    then
      // rule body when AnObject is null
end;
+4
source

Drools Java, ( ), . "" , , LHS , :

exists MyObject()
not exists MyObject()

, , :

obj: MyObject(myProperty == null)
+1

All Articles