Redirected from User Guides/myXML/User guide for OCL rules in XMLdation environment/Available methods for OCL base types/Logical operator: impliesLogical operator: implies
Description of the method
Logical operator implies consist of two parts. Whenever the first part is true, the second part has to be true as well
|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. Note the second occurrence of transaction, expression is true because amount is not above 200.
The other snippet below however would not pass
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.