Functioning (Standard process)
Description
This template is called from a button at the bottom of the screen, a menu, the contextual menu for a field or a function to carryout a procedural process. This process makes a call to the template "window entry" to manage the entry of a criteria window and the entry of a principal window. The criteria window can be composed of one or more tabs. On the other hand to be able to execute in batch mode, it is limited to 500 fields and a field name must not be found on several screens. In this template "standard process", several action are called. The essential action is the EXEC action ; it will contain the procedural process. No update transaction is planned in this template : it is therefore necessary to plan it in the process.
This process can be launched by the submission of a batch request. In this case two phases can be considered : interactive phase for the entry of launch parameters and batch phase for the execution of the process. Two global variables are used to identify the context of the launch :
- GBATCH in parameter entry ( 0=interactive, 1=batch )
- GSERVEUR in process execution phase ( 0=interactive, 1=batch )
The initial entry of the parameters
Is is made by means of a dialogue box or a window entry. When the standard process is launched in batch mode, the first phase (initial entry) is interactive and launched immediately, whilst the second phase (process) is entered in the batch server pending queue. The parameters entered are then entered in the system table ABATRQT, following this, they are reread un the second phase of the process.
Warning !
The number of parameters is limited to 500.
However there is no limit to the length of an alphanumeric field.
Storage in the requests table :
- The DEB(15)(80) field contains the name of the field in the criteria entry screen.
- The FIN (30)(80) field contains the value of the field.
- If the value of the field > 30, the characters > 30 are placed in the following index.
- If the number of fields >80, the current request is saved with DEB(79)="&" and a second record created (request number + 1) with FLAG=99. Seven records can be created in this way.
- A screen field is taken into account if it is not null or empty.
The processes
The template is a supervisor process that calls two annex processes : the standard process and the specific/custom process, if they are entered in the dictionary for the action. These two processes are structured in the same way, that is to say they start with a label ACTION, which process the different events likely to arrive during the execution of the function.
The standard process
This process supplied by ADONIX, must absolutely not be modified by the custom/specific.
The specific/custom process
This process is not supplied by Adonix, but it can be developed (both for the standard functions for which additions are required and for the specific/custom functions).
The Actions
The standard or specific process described by the label $ACTION to write in the following fashion( where XXXXXX is the event code ) :
$ ACTION
Case ACTION
When "XXXXXX" : Gosub XXXXXX
When default
Endcase
Return
Each event is identified by an alphanumeric code contained in the ACTION variable. If there is no process for the event, the functioning of the function will not be impeded by it. It is in the sub-programme $ACTION, that it is pointed to the added label. Within the "ACTION case " syntax is used to specify that as many lines as events are to be completed. The $ACTION is called from the supervisor process by GOSUB ; this therefore makes it possible to use the local variables from the supervisor process.
Attached to this is the list of actions. Next the detailed description of these actions is found. Described here is the calling context for the OBJective of these actions.
Add the specific/custom actions to the standard
By, default, for a single event, the specific/custom action is called before the standard action.
It can cancel and replace the standard action if it sets the variable GPEto the value 1.
To execute the standard action with the specific/custom action, copy the standard process in the specific/custom action, then add the specific/custom process and finally set the variable GPE to the value 1. Example :
Supervisor process
GPE=0
Gosub ACTION From trait_std ( call to the standard )
If GPE=0
Gosub ACTION From trait_spé. ( call to the specific/custom process )
Endif
Specific/custom process
$ ACTION
Case ACTION
When "OUVRE" : Gosub OUVRE
When default
Endcase
Return
$OUVRE
... ( specific/custom action OUVRE )
GPE = 1 (no call to the standard following the specific/custom)
Return