Set Preferences

This section describes how to set preferences for the Code Generation component supplied with NaturalONE. The following topics are covered:


Set Code Generation Preferences

This section describes how to set common generation preferences for Code Generation.

Start of instruction setTo set Code Generation preferences

  1. Select Preferences on the Window menu.

    The Preferences window is displayed.

  2. Expand the Software AG root node.

  3. Select Code Generation.

    The Code Generation preferences are displayed. For example:

    graphics/code-generation-preferences.png

    Using this window, you can:

    Task Procedure
    Enable customized templates and select the folder containing the templates. Select Enable custom templates and use Browse to select the root folder for custom templates (by default, the custom-templates folder).

    Note:
    Do not change the underlying folder structure for the root folder or the code generator will not be able to find the custom templates.

    Display the Generation Progress window after generation. Select Display generation dialog after generating.
    Not display the Generation Progress window after regeneration. Deselect Display generation dialog after regenerating.
  4. Select OK to save the preferences.

Set Logging Preferences

This section describes how to set preferences for logging.

Start of instruction setTo set logging preferences

  1. Select Preferences on the Window menu.

    The Preferences window is displayed.

  2. Expand the Software AG root node.

  3. Select Code Generation > Logging.

    The Logging preferences are displayed. For example:

    graphics/logging-preferences.png

    Using this window, you can:

    Task Procedure
    Assign a log4j.properties file to use for logging. Select Browse and search for the log4j.properties file.

    Note:
    If the log4.properties file is not specified, the <workspacename>/.naturalone folder will be searched for the file; the log4.properties file is optional.

    Not append the Code Generation console view to the NaturalONE Console view. Deselect Append to Natural console.
    Change the location of the logger file. Type the location in Logger.
    Change the logger level. Select the logger level in Level. The logger levels are:
    • INFO

      Over all process Start/Finish. For example: "Regeneration started for CUSTOMER MAINT" or "Regeneration succeeded for CUSTOMER MAINT".

    • DEBUG

      Low-level process Start/Finish. For example: "User exits merged successfully".

    • TRACE

      Very low-level information: For example: "User exit replaced: original:'...' new:'...'" or "WSDL to PDA processing field: MyField".

    Change the logger pattern. Type the pattern in Pattern.
  4. Select OK to save the preferences.

Set Natural Preferences

This section describes how to set preferences for Natural.

Start of instruction setTo set Natural preferences

  1. Select Preferences on the Window menu.

    The Preferences window is displayed.

  2. Expand the Software AG root node.

  3. Select Code Generation > Natural.

    The Natural preferences are displayed. For example:

    graphics/natural-preferences.png

    Using this window, you can:

    Task Procedure
    Check Predict for additional metadata. Select Check Predict for additional metadata.

    Note:
    If this option is selected, three options in the Predict Settings section are disabled. If this option is not selected, use these options to simulate the Predict data.

    Include relationship data from Predict (if available on the server). Select Include relationships.

    Notes:

    1. To enable this option, select Check Predict for additional metadata.
    2. Currently, relationships for DB2 objects are not processed.
    3. The defined field names in the related Predict files have to be unique. Otherwise the generated LDAs and PDAs cannot be stowed successfully. For further information please refer to Qualifying Data Structures in the Programming Guide provided under Natural Language for Windows.
    Suppress the creation of periodic occurrences at the group level. Deselect Create periodic occurrences at the group level.

    For example, a DDM containing a periodic group (PE) named INCOME with four occurrences can be represented as follows:

    • At a group level

      For example:

      2 INCOME (1:4)
        3 SALARY (P5)
        3 CURRENCY (A3)
    • Not at a group level

      For example:

      2 INCOME
        3 SALARY(P5/4)
        3 CURRENCY (A3/4)
    Include all C* variables in the view. Select Include C* variables in view.

    If this option is selected, the C* variables are generated into the code to determine the number of occurrences of a periodic group. For example:

    2 C*INCOME
    2 INCOME
      3 SALARY(P5/4)
      3 CURRENCY (A3/4)
    Change the maximum number of occurrences for a periodic group when not found in Predict. Type the number in When not found in Predict, periodic group (PE) occurrences.

    The number of occurrences of a periodic group is not stored with the DDM and the maximum number of occurrences could be too large to use. To solve this problem, you can define the maximum number of PE occurrences in this field.

    Note:
    If Check Predict for additional metadata is not selected, or if 0 is returned from Predict, the value in this field will be used.

    Change the maximum number of occurrences for a multiple-valued field when not found in Predict. Type the number in When not found in Predict, multiple value (MU) occurrences.

    The number of occurrences of a multiple-valued field is not stored with the DDM and the maximum number of occurrences may be too large to use. To solve this problem, you can define the maximum number of MU occurrences in this field.

    Note:
    If Check Predict for additional metadata is not selected, or if 0 is returned from Predict, the value in this field will be used.

    Allow search keys to be entered in lower case for an object-browse subprogram. Select Allow lowercase search key values for Object Browse.

    By default, the object browse subprogram will convert the starting values for all supplied alphanumeric key components to upper case. If this option is selected, the ALLOW-LOWER-CASE option is generated for all keys and the input values can include lower case characters. For example, if the database contains both upper case and lower case values for the BUSINESS-NAME field (for example, iXpress and IBM) and you select this option, either lower case or upper case input values can be used in a search (for example, "I*" for iXpress and "I*" for IBM).

    Change the maximum number of fields generated for a REQUEST-DOCUMENT subprogram. Type a new number in Maximum number of fields.

    A REQUEST-DOCUMENT subprogram can generate a large amount of code, which may cause memory errors. To avoid this, you can use this option to place restrictions on the REQUEST-DOCUMENT Client code generator.

    Generate the dynamics to support Unicode fields. Select Generate Unicode dynamics.

    This option allows the REQUEST-DOCUMENT subprogram to send and receive Unicode data.

    Note:
    The Natural server must be configured for Unicode.

    Allow the GetByISN option for an Object Maint subprogram. Select Allow GetByISN.

    This option is available for Adabas files. If this option is selected, data can be retrieved using the ISN. Although extra code is generated, performance speed will be enhanced.

    Suppress the generation of DB2 code for SQL database types. Deselect When an SQL database type is found, generate for DB2.
  4. Select OK to save the preferences.