Runtime Error Checking for Message Fields

Each field in a client message and each field in a server message, includes properties that can be used at runtime to enforce certain constraints on the data value that the field may contain. For example, for a numeric field in a message, you can optionally configure a minimum and maximum allowed value. If there is an attempt to set a field to a value that violates the configured constraints, an exception is thrown at runtime.

The exception can be caught by your orchestration and handled to provide an appropriate error message. Refer to Understanding Orchestration and Handling Exceptional or Abnormal Conditions for more information.

In addition, if you create an MVC Web presentation project, a Web Forms Application presentation project, or a Web Forms Mobile Application presentation project, ePortal generates a web page that enforces any constraints that you have configured in the corresponding client message. Refer to the following topics for more information:

Runtime Error Checking for Numeric Message Fields

You can configure the following properties for a numeric field in a client message or a server message:

If ePortal detects an attempt to set a field to a value which is outside the range defined by MinValue and MaxValue, then an OutOfRangeException is thrown. Refer to Handling Exceptional or Abnormal Conditions for more information.

Runtime Error Checking for String Message Fields

You can configure the following properties for a string field in a client message or a server message:

Refer to Handling Exceptional or Abnormal Conditions for information on runtime exceptions.

Other Properties Related to Runtime Error Checking

You can configure the following properties for a numeric or string field in a client message or a server message:

Automatically Configured Runtime Checking for ePortal Messages

When you create a server message, ePortal automatically configures any constraints implied by the artifacts that you used to create the server message. For example, consider the case where you imported the example COBOL 01 record to create an ePortal server message.

For MCP COBOL:

  01 INPUT-RECORD.
     05 NUM-FIELD1          PIC 99.
     05 NUM-FIELD2          PIC S999V9.
     05 STRING-FIELD1       PIC XXX.
     05 STRING-FIELD2       PIC XXX USAGE NATIONAL.
     05 GROUP1-COUNT        PIC 9.
     05 GROUP1 OCCURS 1 TO 4 TIMES DEPENDING ON GROUP1-COUNT.
        10 STRING-FIELD3    PIC XXX USAGE KANJI.

For OS 2200 COBOL:

  01 INPUT-RECORD.
     05 NUM-FIELD1          PIC 99.
     05 NUM-FIELD2          PIC S999V9.
     05 STRING-FIELD1       PIC XXX.
     05 STRING-FIELD2       PIC XXX USAGE DISPLAY-2.
     05 GROUP1-COUNT        PIC 9.
     05 GROUP1 OCCURS 1 TO 4 TIMES DEPENDING ON GROUP1-COUNT.
        10 STRING-FIELD3    PIC XXX USAGE DISP-2.

During the import, ePortal automatically sets the runtime error checking properties  as shown in the following tables. You can override these settings by editing the resulting server message and/or client message. Refer to Modifying Client Messages for more information.

Field NameMax ValueMin ValueStep Value
NUM_FIELD19901
NUM_FIELD2999.9-999.90.1
GROUP1_COUNT411

Field NameRequiredPatternMaxBytesDoubleByteCharsOnly
STRING_FIELD1Falseempty3False
STRING_FIELD2Falseempty6True
STRING_FIELD3Falseempty6True

Note: When importing COBOL, Required is always set to False, since ePortal has no way of knowing if a particular string field is required. Similarly, Pattern is always set to empty since ePortal does not know a particular pattern to enforce. In both cases, the user must explicitly configure these properties in order to cause ePortal to perform runtime error checking; however, when importing MCP SDF forms or OS 2200 DPS forms, an input/output field marked as required has the Required property set to True, and ValidateOnClientInputOnly property set to True.

Disabling Runtime Error Checking for the Entire Data Source Project

Unisys recommends that you enable runtime error checking in order to detect invalid data as early as possible. However, as noted above, you can disable runtime error checking on a field-by-field basis by configuring message field properties appropriately.

You can also disable one or more types of error checking for the entire data source project by configuring the data source project property Runtime Error Checks Performed. Refer to Data Source Project Property Pages Dialog for more information.

Note: ePortal must always verify that a user-supplied data value can be converted to the data type of the corresponding message field. This means that some implied range checking is always enabled for numeric data. For example, if a field in an ePortal message is defined as data type short, then ePortal will always detect a value outside the range for a short (-32768 to 32767) and throw an OutOfRangeException.