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.

    Using this window, you can:

    Task Procedure
    Change the logger level in the Code Generation console view. Select the logger level in Level. The logger levels are:
    • OFF

      No events are logged.

    • TRACE

      Describes events showing step by step execution of code. This data can be ignored during standard operation, but may be useful during extended debugging sessions.

    • DEBUG

      Receive detailed information about events used for software debugging.

    • INFO

      Receive general information about processed events.

    • WARN

      Select this level when an application does not behave as expected but continues to operate along with any key business features.

    • ERROR

      Select this level when one or more features do not function and prevent other features from functioning correctly.

    • FATAL

      Select this level if one or more key business features do not function, and as a result, the entire system does not fulfill your business requirements.

  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.
    Construct model settings Can be used to change the default name to be used for standard parameter SYSTEM.

    Enter a different default name to be used for parameter SYSTEM.

    Note:
    The following description refers to the generation of a new Construct model on the NaturalONE client based on Construct installed on the Natural server as described in section Access the Client Generation Wizards.

    By default, the library name which is specified in the client generation wizards, e.g. as described in section Generate the Modules is used for the standard parameter SYSTEM.

    The system name must be alphanumeric and not exceed 32 characters in length.

    The combination of the module name and system name is used as a key to access help information for the generated module.

  4. Select OK to save the preferences.