[rules-users] Help with my understanding

John.Dubchak at wellsfargo.com John.Dubchak at wellsfargo.com
Wed Dec 19 11:48:27 EST 2007


Hi,

 

We are using Jboss-rules 3.0.5 and I have written a simple rule:

 

rule "Valid Format"

       

       when

              $status : RuleResult()

              $id : Identifier()

              

              eval ($id.getValue() != null)

              eval (!$id.getValue().matches("^([0-9]{9})$"))

       then

              $status.addErrorMessage("Identifier does not match
required format");

       

end

 

In my unit test, I create an instance of the Identifier object and do
not set the Value, therefore it is null by default.  I have an earlier
rule that checks for this null value and places an error message in the
result object appropriately.  I would expect this error to fail and not
see this error message in the result, but instead see the missing value
error message.  The problem is that I see both.  

 

It appears as though the eval null check is failing.  Am I
misunderstanding how this rule should work?  

 

Any insight and/or answers are really appreciated.

 

Thanks,
John

 

 

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


More information about the rules-users mailing list