This document covers the following topics:
Natural Business Services on the server provides sample business services. If you are new to business services, it is recommended that you download the following items from your Natural Business Services (NBS) server, and then make yourself familiar with the programming logic of the downloaded files:
DEMO
steplib
DEMO
domain
SYSBIZDE
system library
Sample DDMs where the names start with NSCT
(for example,
NCST-CUSTOMER
) in the SYSTEM
library
See also the information on the supplied demo applications in Getting Started with Natural Business Services, which is part of the Natural Business Services documentation.
The topics below provide a quick overview of how to download or create a business service. See the remainder of this documentation for more detailed information.
If you are new to NaturalONE, you can find more detailed information on the standard NaturalONE functionality (such as creating projects and libraries, or mapping server environments) in Using NaturalONE. See also the references below.
Business services have to be stored in Natural projects. Other than with the regular Natural objects, it is not possible to download business services into a new project. If you do not want to download the business services into one of your existing projects, you have to create a new project first.
To download a business services
In the Natural Server view, map an environment in which Natural Business Services has been installed. See also Mapping a Natural Environment in Using NaturalONE.
In the Navigator view, create a Natural project which is associated with a Natural Business Services (NBS) server. Since you have mapped this environment in the previous step, you can simply select this server from the second page of the project wizard. At this point, you need not specify any more options in the project wizard. See also Creating a New Project Using a Wizard in Using NaturalONE.
Go back to the Natural Server view and expand the node for the mapped environment.
A top-level node with the name Business-Services is shown if this is an environment in which Natural Business Services has been installed. To view the currently defined domains, expand the Domains node. To view the business services in a domain, expand the node for a domain. Example:
By default, the Business-Services node is only shown when an installation of Natural Business Services can be detected on the server. This behavior can be changed in the Business Services preferences. See also Installation in Setting the Preferences for Business Services.
Select a business service, invoke the context menu, choose the
command. Select the Natural project in the resulting dialog box.The selected business service is downloaded into the specified project. By default, all required resources which belong to a business service are automatically downloaded. This also includes the related subprograms. This behavior can be changed in the Business Service preferences. See also Business Services in Setting the Preferences for Business Services.
If the Construct runtime project does not yet exist in your
workspace, you are asked whether you want to add it to your workspace. You can
then choose the CSTMSG
library
or the screen prompt texts stored in the CSTLDA
library. The
modules in this project will eliminate compile and parsing errors caused by
missing Natural Construct resources. See the
Code
Generation documentation for more detailed information on
the Construct runtime project.
To find out which resources are used by a downloaded business service, go to the Navigator view, double-click the downloaded business service to open it in the business service editor, and then check the resources listed in the Dependencies view. If resources are listed as "<Unknown>" in this view, double-click each unknown resource and confirm to download it from the server. Or manually download the resources from the mapped Natural Business Services environment. Afterwards, make sure that the library containing these resources is defined in your steplib chain file. See also Using the Steplib Editor.
In Navigator view, invoke the context menu for the business service and choose . If any items are still missing, you can view the corresponding messages in the Error Log view. If the required items can be found, the test editor appears. See the Application Testing documentation for detailed information on how to use the test editor.
Business services have to be stored in Natural projects. If you do not want to create the business service in one of your existing projects, you have to create a new project first.
To create a business service
In the Navigator view, create a Natural project which is associated with a Natural Business Services (NBS) server. If you have already mapped this environment previously, you can simply select this server from the second page of the project wizard. At this point, you need not specify any more options in the project wizard. See also Creating a New Project Using a Wizard in Using NaturalONE.
All Natural objects that are required by your business service need to be stored in a Natural library. Therefore, create a Natural library in the new project. See also Creating Libraries in Using NaturalONE.
By default, the business service wizard does not generate subprograms. In this case, you have to program the entire logic of your application manually. However, you can specify that a specific type of subprogram is to be generated (for example, an Object Browse or Object Maint subprogram type). In such a case, you have to specify the Natural library into which the subprogram and other related resources are to be generated.
If you intend to generate an Object Browse or Object Maint subprogram type, you also have to specify a DDM. Make sure that this DDM exists in your project before you invoke the wizard.
Note:
If you select to generate a subprogram, additional pages are shown
in the wizard that are not explained in this documentation. See the
Code
Generation documentation for detailed information on
these subprogram types.
Select the project in which you want to create the business service, invoke the context menu and choose Creating New Business Services later in this documentation.
. Proceed as described inNote:
The context menu is
available when the Service Development component of NaturalONE has been
installed.
In a Natural project, all business services are stored in a folder named
Business-Services. This folder cannot be renamed. For
example, when you have downloaded the DEMO
domain and the
SYSBIZDE
library from the server, your project may look as
follows:
The Business-Services folder contains a subfolder named _steplibs and one or more domain folders, where each folder has the name of the corresponding domain (the above example shows the domain folder with the name DEMO).
The _steplibs folder cannot be renamed. It
contains one or more steplib chains. These are the files with the extension
.steplib. Each steplib chain file defines the steplibs
that can be used by the business services. The file
DEMO.steplib in the above example defines
SYSBIZDE
as the steplib.
Each domain folder contains the following:
A file with the name .domain, which defines the steplib chain to be used. This file cannot be renamed.
As a rule, each domain has a steplib chain file with the same name. For example, the DEMO domain has a steplib chain file with the name DEMO.steplib.
One or more business services. These are the files with the extension .bsrv. Each .bsrv file defines the Natural subprograms which implement the service methods. These subprograms must be located in one of the defined steplibs.
Important:
Even though NaturalONE allows you to rename some of the
above-mentioned folders and files, it is recommended that you do not rename
them after you have defined the business logic.
You can view and change the business service resources in the Business-Services folder with the following editors which are provided with NaturalONE:
Steplib Editor
You invoke this editor by double-clicking a file with the extension
.steplib. This corresponds to the context menu command
.
Business Service Editor
You invoke this editor by double-clicking a file with the extension
.bsrv. This corresponds to the context menu command
.
Domain Editor
You invoke this editor by double-clicking a file with the name
.domain file. This corresponds to the context menu command
.
Each editor provides two tabs. On the first tab, which is always shown by default, you can change the information if required. The second tab is the XML tab, which is read-only and can only be used to view the underlying XML.
Caution:
Always use the editors provided with NaturalONE to edit the
above-mentioned business service resources. Manually editing these files with
different editors can potentially cause problems.
For more detailed information, see Using the Editors later in this documentation.