BEA SWIFT Adapter Specifying Validations for a Field, Specifying Validations for a Sub-field

Page 103

Adding a System Field

Adding a Group

Specifying Validations for a Field

In case where validation needs to be done for the value of a field, it can be specified along with the field definition. The entry for field ‘msg-priority’ (tag 104) is shown below.

<SwiftSystemFieldDef Name="msg-priority" Tag="104"> <Format>1!a</Format> <Specification>(msg-priority)</Specification> <Description>Message Priority, where:

a)S = system

b)U = urgent

c)N = normal

</Description>

<Validations>

<Validation>

<formula>In($value, "S", "U", "N")</formula> <error-code>V08</error-code>

<actionmessage>Invalid Message Priority '" + $value+"'"</actionmessage> </Validation>

</Validations>

</SwiftSystemFieldDef>

The allowed values for the field are ‘S’, ’U’ and ‘N’. This has been specified using the ‘Validation’ tag under ‘Validations’ tag. Any formula that can be used in ‘Designer’ can be specified in the ‘formula’ tag. Error code and action message can also be specified. The error code and action message specified will be set in the exception that occurs when the validation specified fails.

The ‘Validations’ tag is optional. Use it only if any additional validation needs to be done.

Note:

The field value can be accessed only using the ‘$value’ literal.

See Also:

Specifying Validations for a Sub-field

Specifying Validations for a Sub-field

Image 103
Contents Swift Adapter User’s Guide Entering the Swift Specification Exporting a Swift Message Format to Library Swift Terminology Swift message library Swift ConfigurationCustom Swift messages Standard-versionGSCC SRG 2008/standard-version Creating a Swift Format Page Page Page Page Page See Also Creating a Swift Format from an empty message format Page Page Entering the Swift Specification Sequence Without Delimiters Swift SequenceRepetitive Optional Subsequence A1 Linkages Sequence With Start and End DelimitersSequence With Start Delimiter Statu Tag Field Name Content/Options Adding a Swift Sequence without Delimiters Adding a Swift SequencePage Adding a Swift Sequence with Start and End Delimiters Page Adding a Swift Sequence with Start Delimiter Adding a Swift Field Adding a New Generic Field Add the Options for the field Adding Field Options Restrictions on Length Types of Characters Allowed Entering an Option FormatExamples Entering an Option Specification Removing Field Options Specification Sub-Field1 Sub-Field2 Sub-Field2Adding Qualifiers and Associating them with Options Page See Also Specifying or Option for a Qualifier Adding a Non-Generic Field See Also Specifying Field Definition and Usage Mapping Formats with Specification Sub-fieldsPage Page Page Representing Complex Formats in Designer Conventions Field 35B Field 82a Option a Field 82a Option B Field 41a Option D Adding Copy of Fields See Also Updating a Swift Field Page See Also Customize Field Page Removing a Swift Field Date Adding validations for a sub-fieldPage Specifying properties common for all validations Specifying Error Code Specifying Comment Adding Code validationRemoving Codes Adding T14 Validation Adding T26 ValidationSpecifying Date Format Adding Date ValidationAdding Country Code Validation Adding Currency Code ValidationAdding BIC validation Adding Time Offset ValidationSee Also Adding Decimal Validation Adding C05 validationSpecifying Party Identification Codes Adding Party Identification ValidationRemoving Codes Removing Validations from a Sub FieldSee Also External Format Swift Header/Trailer Swift External Format UISwift Input Header/Trailer Page Swift Output Header/Trailer Swift Input/Output Header/Trailer Page Fisc Header Swift Format Options See Also Swift User Message Data Page Swift Sequence Info Swift Field Info Generic Swift Field Qualifier Info Swift Field Info Non-Generic Swift Sub Field Info Creating an empty Service/System message format System/Service MessagePage Click ‘Finish’ to create the System/Service message Page Adding a Simple Field Adding a System FieldPage Page Adding a Complex Field Fields Separated by OR/AND Adding a Group System Field Dictionary Deleting a Field/GroupSpecifying Validations for a Sub-field Specifying Validations for a FieldExpanding/Collapsing Swift Fields Expanding Fields Exporting a Swift Message Format to Library Exporting a Swift Message Format Page Importing a Swift Message Format Scope Sample Exported Html FileRepetitive Optional Sequence A1 Linkages End Of Sequence A1 Linkages Qualifier