OTX Reference  
OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Handler Class Reference

Error Management (Try-Catch-Finally) More...

Inheritance diagram for OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Handler:
Inheritance graph

Classes

class  HandlerRealisation
 Handler realisation. More...
 

Public Attributes

HandlerRealisation realisation
 Handler realisation. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Nodes.Node
System.Boolean disabled
 To turn on/off a node. A deactivated node is not executed at run time. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.UniversalTypes.NamedAndSpecified
ExtensibleData[] extendedData
 Declares general data for NamedAndSpecified which can be extented by new general data defined in new OTX extensions using the standardised extension mechanism. For example it can be used to specify specification relevant content in a better structured way. More...
 
OtxId id
 Unique identifier of an element More...
 
MetaData metaData
 Additional tool-specific data More...
 
OtxName name
 Name of an element More...
 
System.String specification
 Descriptive specification More...
 

Detailed Description

Error Management (Try-Catch-Finally)

The Handler node is designed for monitoring sections of a procedure for unexpected behaviour (exceptions). If an Exception was thrown in the monitored section (Try block), it can be treated by so called catch blocks.

A handler node contains a so called try flow accompanied by a list of catch flows for exception treatment and/or a finally flow. The handler node monitors the try flow for exceptions: When an exception is raised in the monitored try flow, it completes abruptly. If there is a catch flow for treating the kind of exception that was raised, control is passed to that catch flow. After catch execution, node execution will resume right after the handler node (if the catch execution completes normally). Otherwise, if there is no catch for the exception raised, the exception is passed upwards to an outer handler that shall treat the exception, and so on. If the exception is not treated by outer handlers either, the exception is passed to the runtime system itself (out of OTX scope). If there is a finally flow, it will always be executed at the end, disregarding if there was any exception or not or if a catch flow has thrown also or not.

Syntax
try
{
...
}
catch (ExceptionType ExceptionVariable)
{
...
}
[catch (ExceptionType ExceptionVariable)
{
...
}]
[finally
{
...
}]
Examples
// Local Declarations
List<Integer> listOfInteger = {1, 2, 3};
Integer result1;
OutOfBoundsException outOfBoundException;
String result2;
String result3;
// Flow
// listOfInteger is a list of 3 items
try
{
result1 = listOfInteger[6];
}
catch (OutOfBoundsException outOfBoundException)
{
result2 = "I got an OutOfBoundException";
}
finally
{
result3 = "I am in a Finally section";
}

Member Data Documentation

◆ realisation

HandlerRealisation OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Handler.realisation

Handler realisation.