Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 6 Exception Handling : VALIDATEFAIL Exception for Screens

VALIDATEFAIL Exception for Screens
When is VALIDATEFAIL Issued?
VALIDATEFAIL is issued on a DISPLAY statement when a screen contains invalid data and a user uses the Validation Exit key. VALIDATEFAIL is also issued when data inserted into a screen table fails reference checking validation.
Handling of Invalid Data
A VALIDATEFAIL exception can manage an exception issued for invalid data, but the data occurrences containing invalid values are still present in the set of occurrences available to the rule. The invalid values can be read within the exception handler or a subsequent rule in the same transaction. If the data entered is completely incompatible with the field definitions (for example, alphabetic characters in numeric fields) the invalid values are changed to null.
Example Rule
An example of a VALIDATEFAIL exception accessing screen data follows. The rule displays a screen called NEW_EMPLOYEE for the user to add information about a new employee. If the user exits from the screen while a field has invalid data, the VALIDATEFAIL exception sends the data on the screen to an audit trail.

 
RULE EDITOR ===> SCROLL: P
EMPADD(EMPNO);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ EMPLOYEE_INFO.EMPNO = EMPNO; | 1
_ INSERT EMPLOYEE_INFO('NEW_EMPLOYEE'); | 2
_ UNTIL EXIT_DISPLAY DISPLAY NEW_EMPLOYEE : | 3
_ CALL PROCESS_PFKEY('NEW_EMPLOYEE'); |
_ END; |
_ ---------------------------------------------------------------------------
_ ON VALIDATEFAIL :
_ GET EMPLOYEE_INFO('NEW_EMPLOYEE') WHERE EMPNO = EMPNO;
_ CALL ENDMSG('SEE AUDIT TRAIL FOR INVALID DATA.');
_ CALL @OPENDSN('AUDIT.TRAIL');
_ CALL @WRITEDSN(EMPLOYEE_INFO.EMPNO);
_ CALL @WRITEDSN(EMPLOYEE_INFO.LNAME);
_ CALL @WRITEDSN(EMPLOYEE_INFO.POSITION);
_ CALL @WRITEDSN(EMPLOYEE_INFO.HIREDATE);
_ CALL @WRITEDSN(EMPLOYEE_INFO.DEPTNO);
_ CALL @WRITEDSN(EMPLOYEE_INFO.SALARY);
_ CALL @CLOSEDSN;
 
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 
See Also
TIBCO Object Service Broker Defining Screens and Menus about TIBCO Object Service Broker screens.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved