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


Chapter 6 Exception Handling : Coding of Exception Handlers

Coding of Exception Handlers
Signaling Exceptions
You use the SIGNAL statement from within the body of your rule or within the exception handler segment to issue a user-defined exception. This statement is described in SIGNAL Statement.
You must explicitly handle user-defined exceptions. System exceptions are signaled for you. You can handle system exceptions explicitly or TIBCO Object Service Broker can handle them on your behalf.
Handling Exceptions
When coding your rules, you can use:
These statements are known as exception handlers. Except for FORALL … UNTIL, which is described as part of the FORALL Statement, they are described in Chapter 7, The Exception Statements.
Maximum Number of Exceptions
You can handle up to 32 exceptions in a rule, using the ON statements, and UNTIL statements, including UNTIL … DISPLAY and FORALL … UNTIL.
Sample Rule With Exception Handling
The following sample rule signals and handles the user-defined exception DATE_INVALID and explicitly handles the system exception GETFAIL.

 
RULE EDITOR ===> SCROLL: P
MGRINFO(DATE,ID);
_
_ ---------------------------------------------------------------------------
_ VALID_DATE(DATE); |  Y N
_ ------------------------------------------------------------+--------------
_ GET MANAGER WHERE MANAGER_NUM = ID; | 1
_ SIGNAL DATE_INVALID; | 1
_ -----------------------------------------------------------------------------
ON GETFAIL MANAGER :
CALL ENTER_MANAGER;
ON DATE_INVALID :
CALL ENDMSG('Invalid date entered.');
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 

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