Writing DRL is not easy for people new to drools.   Can someone please help me understand how to write this simple rule?  You can see the approaches I have taken.

 

In this case I do not have getters and setters for the attributes I am checking.  I need to pass parameters to the object for it to get the data.

 

I can’t get any of the code in the when block to be syntax proper.  Existing DRL doc is lacking in this area.

 

Thanks  John

 

 

rule "UCCnet_DVE_Depth_All"

      when

            catalogObject : CatalogObject( getElementValue("depth") == null, getElementValue("depth") == "")

#           String depth = CatalogObject.getElementValue("depth")

#           depth == null

#           depth == ""

#           catalogObject : CatalogObject( depth == null)

#           catalogObject : CatalogObject( depth == "")

      then

            logWriter : LogWriter();

            logWriter.logDebug("Package Depth is Blank");

            System.out.println( "Package Depth is Blank" );

end