- Knowledgebase
- Studio Guide
- List of OCL Methods
-
Glossary
-
XML / ISO 20022 Standard
-
ISO 20022 Messages
-
XML Schema
- Miscellaneous
- Attribute
- Closing Tag
- Comment
- Content
- Cvc-complex-type
- Cvc-elt
- Cvc-id
- Cvc-identity-constraint
- Cvc-minexclusive-valid
- Cvc-mininclusive-valid
- Cvc-type
- Cvc-totaldigits-valid
- Cvc-attribute
- Cvc-datatype-valid
- Maximum Length
- Cvc-enumeration-valid
- Cvc-fractiondigits-valid
- Cvc-length-valid
- Cvc-maxexclusive-valid
- Cvc-maxinclusive-valid
- Cvc-maxlength-valid
- Cvc-minlength-valid
- Cvc-pattern-valid
- Element Value
- Encoding
- Length
- Mandatory element
- Missing
- Missing Tag
- Missing Child Element
- MIXD
- Root
- Unsupported Characters
- UTF-8
- Value
- Wrong Declaration
-
EPC SEPA
-
CGI-MP
-
US ACH (Nacha)
-
SWIFT MT
-
Finvoice
-
Bank-Specific
-
XMLdation Service Guides
-
Studio Guide
-
Simulator
.toDate()
Method converts a string to date. After converting to date, the date methods are available.
Description of the method
Description: |
.toDate() method converts a string to date. After converting to date, the date methods are available. |
Available for: | string |
Parameters: | - |
Return type: | date |
Example
Context: | HeaderType1 |
OCL: |
self.InstrId.size() = 35 implies (
let s1 : string = self.InstrId.substring(0,4)
in
let s2 : string = self.InstrId.substring(4,6)
in
let s3 : string = self.InstrId.substring(6,8)
in
let sAll : string = s1+"-"+s2+"-"+s3
in (
sAll.toDate().allowedDaysInFuture(2) and
sAll.toDate().allowedDaysInPast(2)
)
)
|
Description: | The example rule converts <Id> element value to a date and checks that the date is within 2 days into future or past |
Assuming current date is 2018-05-22, the XML snippet below would pass this check.
<InstrId>2018052312345678901BRRRR00000000001</InstrId>
The other snippet below however would not pass this check.
<InstrId>2017052312345678901BRRRR00000000001</InstrId>