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