[rules-users] Need DRL authoring Help

John.Tal at gxs.com John.Tal at gxs.com
Tue Apr 3 13:06:33 EDT 2007


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070403/b7f8a746/attachment.html 


More information about the rules-users mailing list