The Ultra Module(3.1)

A saved format will be referred to by the qualified name under which it was saved (its module name). In APL or UFDL, it can be referred to by the module name followed by a dot and the name of the internal definition. Alternatively import statements can be used to avoid the necessity of always specifying the module name.


The import Statement (APL Code)


In Analysis and Aggregation agents, module names are not needed if the format is selected in the UDR Types list in the configuration dialog of the agent. Also, the APL Editor allows selection of the UDR types from a list. Right-click in the Code Area to display the UDR Assistance... via which the UDR Internal Format Browser can be opened.

If none of these lists are used, the full format name must be referred to, or the import keyword must be used. The module name must be prefixed with ultra.to distinguish format imports from APL code imports.

Example - Referring to UDR Types in the APL Editor

The module in this example is named Default.CDR, and contains the target_internal CDR_TI which is to be used in a function created in the APL Editor.

Case 1 - import statement

import ultra.Default.CDR;
  
 CDR_TI newUDR() { 
    CDR_TI myUDR = udrCreate( CDR_TI ); 
    myUDR.field1 = 22; 
    myUDR.field2 = 55; 
    return myUDR; 
 }

Case 2 - no import

Default.CDR.CDR_TI newUDR() { 
    Default.CDR.CDR_TI myUDR = udrCreate( Default.CDR.CDR_TI ); 
    myUDR.field1 = 22; 
    myUDR.field2 = 55; 
    return myUDR; 
 }


The import Statement (UFDL Code)


It is possible to split different blocks of a format between several format definitions. In these cases, the import statement may be used to avoid referring to the module name. The ultra. prefix is not needed (or allowed) in the UFDL import statement.

Using import in UFDL Code

Suppose there is a format definition with the module name Default.AMA containing an internal myInt, and a new format definition must include the internal in the in_map. This can be accomplished in two ways:

Case 1 - import

import Default.AMA;
in_map exMap : external( myCDR ), 
               internal( myInt ),
               target_internal( myCDR_TI ) {
                 automatic;
};


Case 2 - no import

in_map exMap : external( myCDR ), 
               internal( Default.AMA.myInt ), 
               target_internal( myCDR_TI ) { 
                 automatic; 
};

Note!

  • Referring to ASN.1 structures from outside the format definition will require the ASN.1 module (if defined) to be part of the reference.

  • When invoking the import ultra. function from within the folder that contains the UFDL file, you do not need to specify the folder name.


Name Lookup Rules

Consider the following ASN.1 block example. Depending on from where a format name is referred, the name lookup will work differently.

References from within the asn_block specification:

  • If there is a name in the asn_block specification, choose that name.

  • If there is a name in the same format definition, choose that name.

  • Evaluate the import statements.

References from within the same module but outside of the asn_block:

  • If there is a name in the same format definition (outside of any asn_block specifications), choose that name.

  • If there is a name in the asn_block specification, choose that name.

  • Evaluate the import statements.


Example - Shortened ASN.1 Block

asn_block {
  exchangeRec DEFINITIONS IMPLICIT TAGS ::= 
    BEGIN
      main_udr ::= SEQUENCE
      // Field specifications
};

Note!

References to existing ASN.1 formats in UFDL requires the ASN.1 module to be part of the reference. Suppose the previous external specification, saved under the name Default.myASNformat, is to be included in a new in_map:

Case 1 - import

import Default.myASNformat.exchangeRec;

in_map exMap : external( main_udr ),
               internal( myInt ),  
               target_internal( myCDR_TI ) {
                 automatic;
}; 


Case 2 - no import

in_map exMap : external( Default.myASNformat.
                         exchangeRec.main_udr ),
               internal( myInt ),
               target_internal( myCDR_TI ) {
                 automatic;
};