Validate Value

Function:

The tool can be used to match a property value or file descriptor physical name against a regular expression and return different message types if a value does not match.

It can either be used as part of a standard action descriptor or a modeled dialog validation action. See Validate Action for more information on how to validate values of modeled dialog box fields.

Attributes:

Attribute Type Description
Regex* String The regular expression to be used for validation. Only visible if “Regex From” is set to “Attribute” (default).
Regex From Select Value Whether the regular expression to be used should be set by the “Regex” attribute or an input parameter.

Possible values:

  • Attribute (default)
  • Input Parameter
Regex Case Sensitive Boolean Whether the validation should be case sensitive (default = true).
Message String Custom message to be returned if the property value is invalid.

If no message is specified, a message is generated by AWM. The generated message syntax takes the form:

The value “&INVALID_VALUE.” of “&VALUE_LABEL.” does not match the validation pattern “&REGEX.”.

While the three variables are resolved as follows:

  • INVALID_VALUE: The validated value(s), which did not match the regular expression. If used with mass processing, all invalid values are included and are separated by comma and enclosed in square brackets: [value1, value2, …]
  • VALUE_LABEL: The label of the property or the file descriptor ID, if the physical name of a file descriptor has been validated.
  • REGEX: The regular expression used to validate the value(s). If used as a mass processing input parameter, all used regular expressions are included in the same format as INVALID_VALUE.

These variables can be included in custom messages. They must be referenced by the “Start Reference” (default “&”) and “End Reference” (default “.”) characters as configured in the application options.

Message Type

Select Value

The type of a returned message.

Tool messages are displayed during every modeled AWM action. If “Message Severity” is set to “Error” it aborts the execution with an error message. See Messages for more information.

Validation messages are only supported if the tool is executed within an AWM modeled dialog’s validation action. See Validate Action for more information.

Possible values:

  • Tool Message (default)
  • Validation Message

Message Severity

Select Value

The severity of a returned message.

Error messages cause an action to be aborted (or prevent you from leaving a dialog after the execution of the validation action) while warning and information messages are just displayed to the user without affecting the workflow. The only difference between warning and information messages are their appearance and depending on the operating system.

Possible values:

  • Error (default)
  • Warning
  • Information

Parameters:

Parameter No I/O Type Description
1 [M] I String/Mass Processing The value to be validated.

File input parameters are not supported, but a file descriptor can be referenced (Target ID File) to validate its physical name.

2 [O] I String/Mass Processing The regular expression to be used for validation.

This can be a “String” parameter even for mass processing execution. In this case, it validates all values against the same regular expression.

Only visible, if attribute “Regex From” is set to “Input Parameter”.

Mass Processing

The tool supports mass processing by validating all values of a given mass selection. A message is returned if one or more values do not match the regular expression pattern.

If more than one value was invalid or more than one regular expression has been used, all values are displayed in the generated message or custom message, if the corresponding variables have been used. See the “Message” attribute for more information.

Example using tool "Validate Value" in validation action

The following use case describes how to use the tool to validate a z/OS data set name and member name within a modeled dialog.

Two action descriptors must be defined as minimum:

  1. ACT_EnterMemberAndDataSetName

    1. TOOL_InputDialog_EnterMemberAndDataSetName (AWM Open Modeled Dialog)

      1. Validation Action -> ACT_ValidateMemberAndDataSetName

      2. Input parameter #1: PROP_DataSetName

      3. Input parameter #2: PROP_MemberName

  2. ACT_ValidateMemberAndDataSetName

    1. TOOL_ValidateDataSetName (AWM Validate Value)

      1. Regex = ^[A-Z#$@][A-Z0-9#$@-]{0,7}([.][A-Z#$@][A-Z0-9#$@-]{0,7}){0,21}$

      2. Message Type = Validation Message

      3. Input parameter #1: PROP_DataSetName

    2. TOOL_ValidateMemberName (AWM Validate Value)

      1. Regex = ^[A-Z#$@][A-Z0-9#$@]{0,7}$

      2. Message Type = Validation Message

      3. Input parameter #1: PROP_MemberName

The first action descriptor is used to open the modeled dialog and the second one is referenced as validate action of the dialog tool descriptor. As soon as OK is clicked in the modeled dialog, both validate value tools are executed and return a validation message if a value does not match the regular expression. The validation message are displayed in the corresponding fields.