Specifying validations for a field, Specifying validations for a sub-field – BEA SWIFT Adapter User Manual

Page 103

Advertising
background image

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

Advertising