Insertion relative to the Logical View processing in a Business Component

The code that is generated for a Logical View is in the program body or in the elementary levels that are run by PERFORM. This code contains the standard processing for the implementation of the services in the Logical View. This standard processing is associated with only one Logical View. To add a specific processing, you must then insert it relatively to a standard processing of the Logical View. It is inserted after the automatically generated tag or associated condition.

The information that you enter, except the action type, is identified in the Macro code as:

REF=Processing type Category Service Elementary processing

Here are a few examples:
  • REF=CHUP CATA SRVL TRAN
  • REF=CHUP CATT SRVM CHCK
  • REF=SELC CATR $1
Processing type
The following table lists the general processing in which you can insert a specific processing. The fields that are associated with each processing are indicated.
Table 1. Processing types for a Logical View
Processing types Comments Associated fields
BEGV: Logical View beginning No comment Action type
CCNX: Connect to database No comment Action type
CHKD: Check data The Data Elements that are called in the Logical View are checked. The data that the user enters is checked and an error is sent if the input is erroneous. Data Element code, Category, Action type
CHUP: Check and update This processing carries out the following actions:
  • It checks the user input and sends an error if necessary,
  • It presents the information in the Business Component in the specified format,
  • It refreshes this information with the user input,
  • It updates the database.
Service, Category, Action type
CLOS: Close This processing closes the indexed files of the Logical View. You must specify the file code (Data Structure code). File code, Action type
DCNX: Disconnect from database No comment Action type
ENDV: Logical View ending No comment Action type
ERRV: Logical View errors This processing manages the errors on a service request. Action type
LOCK: Lock This processing blocks data update to avoid simultaneous updates. It prevents inconsistencies. Action type
OPEN: Open This processing opens the indexed files of the Logical View. You must specify the file code (Data Structure code). File code, Action type
SELC: Selection This processing carries out the following actions:
  • It accesses the data that is stored in a database or a file,
  • It reads the data that is requested by the client through the Logical View,
  • It returns the data to the client.
Service, Category, Action type
TRDT: Transfer View to Segment This processing transfers data from the Logical View to the Segments. Category, Action type
TRER: Errors transfer This processing transfers the errors when a second-level Business Component is called. You must indicate the code of the Segment where the error can be detected Segment code, Action type
TRVW: Transfer Segment to View The second-level Business Component transfers the data from the Segment to the Logical View. Category, Action type
UNLK: Unlock No comment Action type
USER: User service This processing runs a special service that is not a selection service or a check and update service. You can create a user service, for example, to count the number of persons who put in an order or to describe a print service.

The Business Component retrieves, through the communication area, the name and code of the user service that is requested by the client.

User service code, Action type
Service
This field is available for a general processing type CHUP: Check and update or SELC: Selection. You must specify in which service type you want to insert the specific processing.
For a processing type CHUP: Check and update, you can insert a specific processing in the following services:
  • SRVE: Check service
  • SRVL: Read service
  • SRVM: Check/update service
  • SRVT: Check/update/selection service
  • SRVX: Check/selection service

For a processing type SELC: Selection, you can insert a specific processing in the service SRVA: Selection service.

You can parameterize the service to identify it in various use contexts. To do so, enter a $ symbol followed by a digit or a letter directly in the field.

Elementary processing
This field is available only if you select a service for a general processing type CHUP: Check and update or SELC: Selection.

The elementary processing is run by PERFORM from the Logical View level. You can specify in which elementary processing you want to insert the specific processing.

The list of the available elementary processing varies according to the selected service. The complete list is as follows:
  • No value: The specific processing applies to all the elementary processing of the selected service.
  • INIT: Initialization
  • CHCK: Check
  • TRAN: Transfer
  • UPDT: Update
  • DONE: End
  • SELC: Selection

You can parameterize the elementary processing to identify it in various use contexts. To do so, enter a $ symbol followed by a digit or a letter directly in the field.

File code
This field is available for a general processing type OPEN: Open or CLOS: Close. You must indicate the file code, which is the Data Structure code.
Segment code
This field is available for a general processing type TRER: Errors transfer. You must indicate the code of the Segment where the error can be detected.
User service code
This field is available for a general processing type USER: User service. You must enter the user service code on 25 characters maximum.
Category
You must indicate a category for a general processing type CHKD: Check data, CHUP: Check and update, TRDT: Transfer View to Segment, TRVW: Transfer Segment to View, or SELC: Selection.
The following categories are possible:
  • CATT: Iterative (number of occurrences =1)
  • CATR: Iterative (number of occurrences >1)

You can parameterize the category to identify it in various use contexts. To do so, enter a $ symbol followed by a digit or a letter directly in the field.

Action type
Specific processing is inserted in a Business Component relatively to the standard generated processing. You can then benefit from the generated processing and adapt it to your needs. You indicate where the specific processing is to be inserted relatively to a standard processing of the Logical View.
You must select one of the following values to insert the specific processing:
  • Begin: The specific processing is inserted at the beginning of the standard processing, after the start tag. This positioning can be used only for the processing that is run by PERFORM. It is not available for all the general processing types. The positioning of this specific processing is identified by ACTION=*B in the Macro code.
  • Insert before a standard SQL clause. The specific processing is inserted before the start tag of the standard processing.

    In the Macro code, the positioning of this specific processing is identified by ACTION=*A. In the Business Component code, it is identified by @BEFORE.

  • Insert after a standard SQL clause. The specific processing is inserted before the end tag if the hierarchical level is greater than the level of the standard processing. It is generated after the end tag if the hierarchical level is identical to the level of the standard processing.

    In the Macro code, the positioning of this specific processing is identified by ACTION=*P. In the Business Component code, it is identified by @AFTER.

  • Replace a standard SQL clause. This choice can be activated only if no specific subfunction has already been inserted in the SQL clause relatively to the attachment point (WHENEVER clause or DECLARE CURSOR clause on the same Segment). If a specific subfunction has already been inserted relatively to the attachment point, you must first remove it.

    In the Macro code, the positioning of this specific processing is identified by ACTION=*P. In the Business Component code, it is identified by @REPLACE.

  • Insert: This option is specific to a user service. The user service is inserted in the Logical View, in any subfunction that depends on a level 05 function. The positioning of this specific processing is identified by ACTION=*C in the Macro code.

Feedback