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=Processingtype Category Service Elementaryprocessing
- REF=CHUP CATA SRVL TRAN
- REF=CHUP CATT SRVM CHCK
- REF=SELC CATR $1
In the Business Component code, these insertions are identified as
Processingtype Category Service Elementaryprocessing, after the annotation for the relative position (*@BEFORE, *@AFTER, or *@REPLACE).
- 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 Action type CCNX: Connect to database 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, and Action type CHUP: Check and update This processing completes 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, and 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, and Action type DCNX: Disconnect from database Action type ENDV: Logical View ending 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, and 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, and Action type TRDT: Transfer View to Segment This processing transfers data from the Logical View to the Segments. Category, and 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, and Action type TRVW: Transfer Segment to View The second-level Business Component transfers the data from the Segment to the Logical View. Category, and Action type UNLK: Unlock Action type USER: User service (from version 9.6 iFix 001) 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.
Action type Note: To specify the use of a user service, which is entirely managed with specific code, you must call the ££USER protected Macro in the -CP Lines of the Business Component. The user services that are called in another way are ignored. From Rational® Programming Patterns V9.5.1, they constitute inactive code that you can remove. A warning is automatically displayed in the COBOL code. This case also applies to the user services that were called from the function and subfunction wizard in an earlier version of Rational Programming Patterns.
- 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:- If no value is selected, 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.
- 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 and by *@BEGINNING in the Business Component code.
- Insert before a standard processing or 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 processing or 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 processing or 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=*R. In the Business Component code, it is identified by *@REPLACE.