[rules-users] Test for null object, not null property

Mark Proctor mproctor at codehaus.org
Tue Aug 14 11:21:04 EDT 2007


no but you can do:
not( Building() )

Mark
Stuart Moffatt wrote:
> The incoming building was initialized like this:
>
> Building building = null;
> FactHandle buildingFact = businessRuleSession.insert( building );
> businessRuleSession.setFocus("validate delete or get building");
> businessRuleSession.fireAllRules();
>
> Can drools test for this null building?
> What should the rule look like?
>
> rule "building is null"
>     agenda-group "validate delete or get building"
>     salience 10
>     when
>         boException : BOException()
>         Building() == null  /* this is the problem here -- not sure 
> what this should look like */
>     then
>         boException.setCode("BO-0008");
> end
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

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


More information about the rules-users mailing list