Creating New Business Services

This document covers the following topics:


Using the Business Service Wizard

With NaturalONE, it is only possible to create business services locally, in a Natural project. It is not possible to create them directly on the NBS server.

You create business services using a wizard. The business service wizard generates many resources required by the service. These include the business service file, the domain folder and .domain file, and the steplib chain file.

By default, the wizard checks for existing business services on the Natural server and displays a warning message if they already exist. It generates the supporting resources (domains and steplib chain files) if they do not yet exist locally. This default behavior can be modified in the Business Service preferences. See Business Services in Setting the Preferences for Business Services.

Start of instruction setTo use the business service wizard

  1. In the Navigator view, select the Natural project in which you want to create the new business service.

  2. Invoke the context menu and choose Business Services > New Business Service.

    Or:
    From the File menu, choose New > Other. In the resulting dialog box, expand Software AG > Business Services, select Business Service and choose the Next button.

    The New Business Service dialog box appears.

    Business service wizard

  3. Specify the following information:

    Option Description
    Natural project name The project in which the business service is to be created. If you have selected a project before invoking this dialog box, the project name is automatically shown in this text box.
    Domain If your project already contains one or more domains, a domain name is provided. If you do not want to use the provided domain, you can either type the name of a new domain that is to be created, or - if more domains are defined in your project - you can select the name of a different domain from the drop-down list box.
    Service Name The default name "NewService" is provided. Type an appropriate name for the new service.
    Version The default version number "1.0.0" is provided. Type an appropriate version number for the new service.

    The version number consists of three parts that are separated by dots. It must match the following format:

    nn.nn.nn
    Description Type a brief description of the service.
  4. Choose the Finish button if you do not want to generate a subprogram for your business service.

    Or:
    Choose the Next button if you want to generate a subprogram for your business service.

    When you choose the Next button, the following dialog box appears.

    Business service wizard

  5. If you want to generate a subprogram, select one of the following options:

    Option Description
    Object browse Generates a subprogram that provides browse functionality for a Natural object. Parameter data areas are also generated. You have to specify the name of an existing DDM for this purpose.
    Object maint Generates a subprogram that maintains complex data objects and updates all entities within an object. Local data areas and parameter data areas are also generated. You have to specify the name of an existing DDM for this purpose.
    Object skeleton Generates a skeleton subprogram which uses the input/output parameters and default methods that you specify in the wizard.

    If you select one of the above options, additional pages are shown in the wizard that are not explained in this documentation. For detailed information on the above modules and the options that you have to specify in the wizard, see the Code Generation documentation.

    Note:
    The above modules can also be generated when you invoke the Code Generation context menu for a project.

  6. Choose the Finish button to generate the business service file and, if specified, the subprograms. If they do not already exist, the associated domain and steplib chain files are also generated.

    The newly created business service is automatically shown in the business service editor. For more information (for example, on how to add methods to the business service), see Using the Business Service Editor.

Next Steps

After you have generated a business service using the wizard, you can proceed as described below:

  1. Make sure that your domain information is correct. See Using the Domain Editor.

  2. Create all libraries that are to be used as steplibs.

  3. Make sure that your steplib chain file defines all steplibs that are to be used. See Using the Steplib Editor.

  4. If you have not selected to create a subprogram in the business service wizard: create the subprogram that implements the methods that are to be used by your business service.

  5. Add all required methods to the business service. See Using the Business Service Editor.

  6. Upload all business service resources. See Uploading the Business Service Resources.

  7. Test the business service. See NaturalONE's Application Testing documentation for detailed information.

File Name Format for Business Services

The name of a business service file is composed of the service name and a version number, separated by a dot. The version number consists of three parts that are also separated by dots. When you rename a business service file, you have to keep this structure. The name must match the following format:

name.vnn.nn.nn.bsrv

For example, MyCustomer.v3.2.1.bsrv or MyOrder.v1.10.20.bsrv.

It is recommended that you do not rename a business service file after you have defined the business logic.

Uploading the Business Service Resources

All objects that are addressed by a business service must be stored in an FNAT or FUSER system file on the server. You use the standard NaturalONE functionality to upload the business service file and all other generated resources (such as the domain file and steplib chain file) to the server.

When a business service is uploaded, it is placed into the NBS repository on the server (LFILE 135). During the upload, it is not checked whether the objects that are used by the business service already exist. When the business service is executed, however, it is checked whether all defined subprograms are available.

When the option Build Natural projects automatically is enabled in the Natural preferences, the appropriate server is automatically updated each time you save a business service resource in the Eclipse workspace or when you add a new business service resource. When this option is disabled in the Natural preferences, you have to update the server manually. The business service files, domain files and steplib chain files need not be stowed or cataloged on the server. Therefore, you can simply use the Upload command.

If you change your steplib definitions after the upload (for example, when you define a new library), you have to make sure that the updated steplib chain file is uploaded to the server.

If you save your data in the repository of a version control system, you have to make sure that this data is available in Natural when the service is executed.