Redirected from User Guides/myXML/OCL Rules/Available methods for OCL base types/Logical operators: and, or, xor, notLogical operators: and, or, xor, not
Description of the method
Logical operators compare expressions and return a boolean value, depending on which operator is used
|Available for:|| |
base64binary, boolean, datetime, double/decimal, date, hexBinary, integer, string, double/decimal and integer
self.Amount > 200 implies
self.Debtor.Name->size() = 1 and self.Creditor.Name->size() = 1
|Description:||The example rule mandates the usage of both Creditor and Debtor name when Amount exceeds 200|
The XML snippet below would pass this check.
The other snippet below however would not pass this check as the value is different from "IdContent".
Please note that in order to make the feedback for user as accurate as possible, this exact rule may be divided into two separate rules. The individual rules would be:
if Amt exceeds 200, then Creditor Name is mandatory
if Amt exceeds 200, then Debtor Name is mandatory
This way error report will always point out the erreneous case, as the query and error message for each rule can be different.