.min()
Table of contents
- 1. Description of the method
- 2.
- 3. Example
Description of the method
Description: | .min() method compares the given value to the value of the parameter and returns the lowest one. |
Available for: | integer, real |
Parameters: | integer, real |
Return type: | integer, real |
Example
Context: | Message |
OCL: | self.Transaction.at(0).Amount.min(self.Transaction.at(1).Amount) = 30 |
Description: | The example rule compares the lowest amount from the first and second transaction amounts to the right side operand. It's assumed that there is at least two transactions. |
The XML snippet below would pass this check.
<?xml version="1.0" encoding="UTF-8"?> <Message xmlns="http://www.XMLdation.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
The other snippet below however would not pass this check. (The lowest amount, 15, is not equal to 30)
<?xml version="1.0" encoding="UTF-8"?> <Message xmlns="http://www.XMLdation.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |