External Interfaces
The External Interface definition type is used to make relations visible between reports that call an external library and the external interface definition, and to validate calls to external libraries.
It is important to note that the actual external library is not being accessed, this object is both a visual aid to help developers keep track of all the objects where the external library is called as well as tool to validate the call syntax.
Creating an External Interface Definition
To create a new External Interface Definition, do as follows:
- Open the folder for the application to which you want to add the external interface definition.
This is done from the Repository window. - Select the folder "External Interfaces" which is a subfolder of "Types" or one of the underlying subfolders and insert a new external interface.
This can be done by right clicking on the selected (sub)folder and choosing "Insert External Interface" from the popup-menu. A dialog box will be displayed:
- Specify the options for the external interface definition in the displayed window. The name of the External Interface definition should be the same as the external library name.
In the type panel, you define the type of Type that you want to create, at the moment there is only the type External Interface available. If you selected the subfolder that indicates the correct type when calling the dialog box, this type will be selected automatically. - Click "OK" to add the external interface definition, and to define its settings.
- Select the nodes to set the applicable external interface definition options and to implement the code.
More details about the screens that are linked to these nodes can be found by clicking the applicable link under "Adjusting an external interface definition". - Save the external interface definition.
The save buttons can be found in the top toolbar of the Developer.
Adjusting an external interface definition
If you double click on an external interface definition, the following options for that external interface definition will appear:
Deleting an external interface definition
An external interface definition can be removed from the repository through the screen "Revision Control".
Using external interfaces
After an external interface has been defined and checked in using the Revision Control, objects that call the external library with the same name as the external interface definition will display a relation to the external interface in the 'Relations' node after being generated.
Depending on the validation settings of the external interface definition, the call to the external library will be validated along with the next validation of its parent object, with warnings or errors given for discrepancies between the call and the external interface definition.
Example:
A COBOL program named 'CALLTEST' is calling an external library named CallTestLibrary.dll
call 'CallTestLibrary.MathExample.Multiply' using call-param1, call-param2, call-param3 returning call-returncode.
if call-returncode is zeroes
display call-param1
else
display 'Error: ' call-returncode
end-if.
An External Interface object named 'CSharpExternalLibrary' is created, defined and checked in. The validation option is set to 'Validate defined routines. Error when validation fails' and not to 'STRICT' as our COBOL program only calls one of the two defined routines.
After the report has been generated, its 'Relations' node lists the external interface.
And the 'Relations' node of the External Interface lists all the objects where the library is called, with the called routine listed as comment.