-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard,

Gundersen, Richard wrote:
> Can anyone please tell me why this works. It's two versions of a
> validation rule from my commons validator xml file (for a validwhen
> condition):

The parser that the validation package uses cannot parse expressions of
the form "A or B or C" ("or" can be replaced with "and" anywhere, here).
They have a relatively simple expression syntax that only supports
binary logical expressions (although, without too much trouble, adding
right- or left-associativity for logical operators isn't really that
tough, and most programmers expect that kind of thing).

So, instead, you have to do this:

(A or B) or C

Looking at your "it doesn't work" scenario, you have the situation above
that I mentioned if you just call this "A":

((oldProductStatusId == 21) and ( (productStatusId == 21) or
(productStatusId == 23)))

and this "B":

 ((oldProductStatusId == 23) and ( (productStatusId == 23) or
(productStatusId == 22))) or

and this "C":

 ((oldProductStatusId == 23) and ( (productStatusId == 23) or
(productStatusId == 22)))

You need to wrap your first two logical combinations in yet another set
of parenthesis.

Hope that helps,
- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfsK29CaO5/Lv0PARAgo7AJ0fnVh+txKFyhavKipygARIBnzOHQCghmmM
lcfyDekvb8qyLLMA1avH56A=
=Qhoz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to