ExternalType part

ExternalType parts map EGL to external language elements.
The ExternalType part can have any of three stereotypes:
An ExternalType part has the following characteristics:
An ExternalType part consists of the following components:
Variable declarations
These provide access to public variables in the external language element.
Function prototypes
These represent method invocations or function calls in the external type.
Constructor prototypes
These define the syntax for constructing a variable of this external type using an EGL new statement.
For more information, see the Introduction to ExternalType parts.

Syntax

Syntax diagram for ExternalType part
typeName
The name that you assign to the part type. Use this name in the statement that creates a variable of this type.
externalType
The extends clause refers to another ExternalType definition that contains function and or variable prototypes that this type inherits.
stereotype
One of the following kinds: JavaObject, JavaScriptObject, or HostProgram.
variableDeclaration
This prototype declaration represents a variable in the external type. No storage is assigned, so you cannot use initializers with these declarations. Use EGL syntax and base the variable on EGL primitive types that correspond to Java types. For more information, see EGL primitives and Java.
static
This keyword indicates that the specified function or variable exists apart from a variable based on the external type, and that you can reference it using the syntax typeName.functionName().
functionPrototype
This prototype declaration represents a function in the external type. Do not include any actual code in this declaration, but specify parameters and return values by using EGL syntax. Primitive types that you pass as parameters must include the in modifier.
parameters
These are the parameters that EGL needs to create a variable of this type using the new statement. Use typeName for the part name in the new statement; see new operator

Example

The following example shows an ExternalType part with function prototypes:

ExternalType TaxModule type JavaObject
  // Define public variables
  adjustedGrossIncome FLOAT;
  companyName STRING;

  // Define function prototype
  function calculateTax (adjIncome FLOAT in) returns (FLOAT);

  // Define constructor prototype
  constructor (taxAuthority STRING);
end

// Invoke the above constructor in new expression
myTaxModule TaxModule = new TaxModule("NC") {
  adjustedGrossIncome = 60135.00,
  companyName = "CompanyB" };

myTax = myTaxModule.calculateTax (myIncome);

Compatibility

Table 1. Compatibility considerations for ExternalType parts
Platform Issue
COBOL generation ExternalType parts are not supported.

Feedback