Logical operator: implies
Table of contents
Description of the method
Description: | 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 |
Parameters: | - |
Return type: | boolean |
Example1
Context: | TransactionType1 |
OCL: | 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.
<Transaction> <Transaction> |
The other snippet below however would not pass
<Transaction> |
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.