Catch

LANSA Composer

Catch

You can place one or more Catch Processing Directives after an Activity, Transformation Map or Processing Sequence directive.  For each Activity, Transformation Map or Processing Sequence directive, a maximum of one and only one of the Catch blocks (if specified) will be executed.  The block executed will be the first that matches the result code from the Activity, Transformation Map or Processing Sequence directive. 

Each Catch Directive can itself have child items that are executed when the Catch item is activated.  If a Catch block is activated, any error condition is handled and the activation of the Catch block will prevent the error from ending the Processing Sequence.  If you wish, you may explicitly end the Processing Sequence (with or without error) by including a Terminate Directive in the Catch block.

You can specify the following details for Catch Directives:

Result code

Specifies the condition that will activate the CATCH directive.  If you select 'Errors', the CATCH directive will be activated when the Activity return code signifies an error ('ER').  If you select 'OK', the CATCH directive will be activated when the Activity ends without error.  (The latter case is less usual, but it allows you to specify alternate error handling and normal completion actions.)