It can be launched in batch mode. Its aim is to perform the operations to bring the folder in a usable state, i.e. a state where connection and normal operations are possible on the corresponding endpoint.
The folder validation is a complex process that handles several cases:
The creation of an history folder is done from the Creation of Purge folder function.
The process description has several steps, and these steps are described here.
If a history folder exists for a given folder, its revalidation is done in a second step, and can even be done much later (if for instance the environment where the history folder is installed remains as a stand-alone environment). But a history folder can only be migrated after migration of the folder it is attached to.
The history folder revalidation is only available for a migration that goes from version 150, version 6, version7, or upgrade 8 to upgrade 9 or later. Beware that this requires a minimum level of patches or maintenances depending on the version.
The following list gives the prerequisites:
Product | Version or upgrades | Minimum patch list or maintenance |
Sage X3 | Version 5 | Maintenances 7401 and 7402 must be installed |
Sage X3 | Version 6.x | Patch list >= 33 |
Sage X3 | Version 7 | Patch list >= 10 |
Sage X3 | Upgrade 8 | Patch list >= 2 |
Sage X3 People | Version 5 | Maintenances 2211 and 2212 must be installed |
Sage X3 People | Version 6 | Patch list >= 29 |
Sage X3 People | Version 7 | Patch list >= 3 |
The folder validation first tests the parameter of the validation, with the following actions:
If some of the preliminary checks fail, the revalidation process will stop and the log file will give the reasons for this failure.
If the folder is revalidated, the folder is first switched to mono-connection mode (no user can connect to the folder during the revalidation). This is of course only possible if no other user is already connected, otherwise the revalidation fails.
Flags defining if elements in dictionaries will have to be validated. By default, the revalidation is set to No except if we are in folder creation. In the next steps, the flag can be set to Yes by one of the upgrade procedures.
If the folder is created, a set of directories will be created in the application folder, and the scripts that create the database user with the corresponding tablespaces are run as well.
If the folder is revalidated, a check is done and the additional directories can be created (for instance when a language is added or if a new directory has been defined in the reference folder).
If the validated or revalidated folder is an history folder, the local dictionary elements (local table description) are created according to the data already stored, the dedicated menu files and text files used for the user interface are generated.
If the migration plans have been enabled:
The tables are now updated using the AMAJ routine located in the DOSMAJ scripts. The principles are the following:
The table dictionary is now updated and the revalidation of all the modified tables will occur. This will drop the standard columns that are no longer present in the version and reindex the existing tables.
The movement tables transformation is also managed by this step. But if the migration plans have been used, the movement tables will be empty and the update will be performed later.
If deliverables or kits have been added, they are copied from the reference folder (this step is not performed on a history folder).
When revalidating a normal folder, the dictionary content is updated for all the elements. This includes tables, views, actions, screens, objects, windows, data types, action parameters, functions, reports, activity codes, general parameters, miscellaneous tables, purge formulas, system transactions, inquiries, navigations, transactions, memo codes, type prototypes, global variables, constants, context variables, sub-programs, formula assistant contexts, URLs, documentations, data models, classes, representations, help keywords, entry points, business object related dictionaries.
The update takes into account the changes that have been made (especially new activity codes, new legislations).
The tables are now revalidated according to the new dictionary definition: columns that are no longer present are deleted, indexes are recomputed.
If we are updating a non history folder, depending on the changes in the setup, some data might be copied from the reference folder (for instance if a language code has been added, if new setups are delivered in a table and copied). The possible operations are the following:
At this step, a link control procedure is executed on all the table except the movement tables if the migration plans are used.
Still for non history folder on this step, the dictionary elements are validated:
For history folder updates, only the tables and views are generated and validated (all the other dictionary elements are inherited from the main folder).
If the we are in an upgrade process for non history folders, the MAJ routine in DOSMAJ* scripts are run, in the right order: for every release gap, a dedicated DOSMAJ* can run.
For instance, to go from release X1 to Xn, the intermediate DOSMAJ that might exist to go from X1 to X2, from X2 to X3... from Xn-1 to Xn will run successively.
This process can, for instance, perform additional updates. This step runs for both history folders and normal folders, but the scripts executed can of course be different.
If we are upgrading a non history folder, the classes and representation links are updated and the validation flag is set to trigger the validation later.
Still on a non history folder validation, the following operations are performed:
This step is relevant only if we are in an upgrade process and if the migration plans have been selected (otherwise, the folder validation is finished).
At this step, all the main parameters and dictionary tables are up to date, but all the movement tables are empty, and the corresponding data is located in the U* tables.
Running the migration plan steps will transfer the data by massive insertion into the final movement tables. This can be done with several steps in parallel, and is defined by the migration plan setup.
When finally this step is finished, the folder is again ready for normal operation. The U* table remain with the movement data image before the migration. They can be purged later (for instance after a given period of normal operation, to be able to analyze further data inconsistencies that were not detected).
They need to be purged before the next upgrade will be done. This is done with the function TRTMIGDEL.
The following limitations apply to application table upgrade in history folders:
The consequence is that the following V6 fields will remain empty on the historized data:
You should also remind that the accounting cumulated tables (BALANCE, BALANA, BLACMM, BLAQTY) are erased in V6. The migration procedure resynchronizes the balance table. If you want to use balance historized data, the GACCENTRY* and GCOMMIT* tables must also have been historized.
If the folder validation is carried out while the folder to be updated is in an earlier version to the reference folder version, this phase will call the standardised update processes that must be applied (if they exist) before the structure of the data can be updated. The update processes are executed successively when moving from one version to another that are not immediately consecutive.
Created here are the directories that do not exist in the folder hierarchy (for example, those dependent on the language if a new language is used in the folder).
The dictionary tables (i.e. those whose type is X3 Dictionary) are revalidated if their structure has changed.
All the texts found in the ATEXTRA table (texts in the dictionary), are copied here from the reference folder to the folder being revalidated. The precise process is as follows :
It should be noted that this copy is made for all the standard languages managed in the folder being validated (and also for the software installation language, even if this language is not managed in the folder being validated). In the specific/custom languages no copy process is carried out.
This text copy phase (including specific/custom) signifies that at the end of the copy, there will be an absolute concordance between the text numbers in the reference folder and the revalidated folder, except for texts that did not exist in the reference folder.
It should be noted that the synchronisation phase in a 3 tier architecture, was not automatically assured in version 130. The consequences not being neutral for the management of specific/custom texts. They were as follows :
The local menus are recopied here and the messages from the reference folder to the live folder, except in the following cases :
This copy is made for all the standard languages managed in the folder being validated (and also for the software installation language, even if this language is not managed in the folder being revalidated). In the specific/custom languages no copy process is carried out.
In this phase, the local menu dictionary is also updated following the same rules.
This update will be carried out for all the database tables except those of the dictionary. In principal there is a comparison in the dictionary for all these tables, between the reference folder and the folder being validated.
Warning, in this phase, only the dictionary is updated (the database tables will be revalidated in a later phase).
In addition, it should be noted the number of records that will have been entered in the header of each table in the folder being validated is not updated if it is greater than the result of the sizing calculation or the value defined in the reference folder.
The other dictionary elements are updated in the following order :
ORDER | DICTIONARY ELEMENT |
1 | Actions |
2 | Screens |
3 | Objects |
4 | Windows |
5 | Data types |
6 | Parameters |
7 | Functions |
8 | Reports |
The rule remains the same : any element that does not exist in the folder being validated is created, any standard element that no longer exists in the reference folder is deleted, any specific/custom element is respect, except in the case of 3 tier architecture with vertical activity codes. This logic extends in the same way, to the sub-elements (i.e. a field in a standard screen protected by a custom/specific activity code is created if it does not exist in the folder being validated ; if it already exists, no update takes place).
In addition, some information exists that is never updated by the transfer from the reference folder (except of course if the dictionary element did not exist before the validation in the folder to be validated). The includes the following information :
In addition, it should be noted that the dictionaries are updated, but that the screen validation and in the general fashion the generation of the code associated with the dictionaries will be made in a later phase.
This starts with the deletion of all the lines in the ACTIV table in the folder (including those starting with X, Y or Z). The the lines are recreated from the new folder parameters contained in the ADOSACT table in the supervisor folder (with the value Active or Inactiveaccording to the case and the associated sizing parameters).
This starts with the update of the parameters dictionary in the following fashion : any parameter not existing in the folder being validated is created, any standard parameter that no longer exist in the reference folder is deleted, any specific/custom parameter that already exists is not touched, except in the case of 3 tier architecture with an activity code vertical, any modified standard parameter is updated.
The parameter values defined at the level of the folder in the reference folder are copied, if they do not exist in the folder being validated.
It is important to note that, unlike version 130, it is now possible to create the specific/custom parameters (starting with X,Y or Z) protected by activity codes in each of the standard chapters (before, it was necessary to create them in the dedicated chapters starting with X, Y or Z).
This starts with the update of the miscellaneous table dictionary in the following fashion :
The update of the structure for each miscellaneous table is copied to the codes contained in this table in the following fashion.
It should be noted that tables 901 to 999, reserved for the supervisor, are always recopied (parameterization and contents) from the reference folder (they are never considered as specific/custom).
The update principal is as follows : any formula not defined in the folder being validated is created, any standard formula that no longer exists in the reference folder is deleted, any specific/custom formula that already exists is not touched, except in 3 tier architecture and vertical activity code, any modified standard formula is updated for all the definition elements (i.e. the date, time, frequency as well as the Active flag is not modified).
This is the update of the dictionary type : any element not defined in the folder being validated is created, any standard element that no longer exists in the reference folder is deleted, any specific/custom element that already exists is not touched, except in 3 tier architecture and vertical activity code, any standard element modified is updated.
The corresponding elements are :
ORDER | DICTIONARY ELEMENT |
1 | System transactions |
2 | Inquiries |
3 | Navigations |
4 | Application transactions |
The revalidation of all the application tables where the structure has been modified in pahse (6) is then carried out by using valfil.
If SQL scripts exist stored in the PCD directory of the reference folder, in the form of ASCII folders, starting with majdos, with the extension sql, these scripts are executed (in creation, the script root is credos). This is used to foresee the creation of automated views for example, that did not exist in version 130. It is important to note that these scripts :
can contain the comments, the lines starting with the # character being ignored.
can contain the folder name, in the form of a variable named %nomap% : the substitution of this variable will be made before the execution of the script.
are limited to 100 lines (comments and empty lines excluded) of 250 characters. But it is however possible to execute several scripts, the scripts being executed in alphabetical order of the file names.
are executed by means of the Adonix engine (the connection is as the user corresponding to the folder name and with the privileges accorded by the roles user_ADONIX and admin_ADONIX).
The data copy phase is used to transfer the data in the tables coming from the copy folder. This copy is made, in the context revalidation, that in the newly activated tables in the case where for example a module has been activated that was not previously. Of course, this copy can be automatic or conditional (i.e. dependent on the information entered in the Init tab in the folder management).
This phase corresponds to the validation of the different elements in the dictionary. Only the elements modified in the previous phases will be revalidated (with the exception because of a version change for example can impose a regeneration code). The revalidated elements are in the following order :
ORDER | DICTIONARY ELEMENT |
1 | Screens |
2 | Objects |
3 | Windows |
4 | Inquiries |
These validations are, if necessary, carried out for all the languages in the folder (and also in the installation language if it is not one of the folder languages).
This phase carries out a referential integrity control on the data copied during the folder update, if this has taken place (phase 15). It verifies the totality of the records in these tables. If the value of the fields linked to the other tables does not correspond to the value of an existing key, the copied record is deleted if the link is mandatory ; if the link is not mandatory, the record is recreated with an empty key value.
If the folder validation is carried out while the folder to be updated is in an earlier version to the reference folder version, this phase will call the standardised update processes that must be applied (if they exist) after the structure of the data can be updated. This includes for example the fixing of the default values in the new fields in the standard tables. The update processes are executed successively when moving from one version to another that are not immediately consecutive.
It should be noted that this prevents the creation of a field in a given version, it gives it a value in this update phase, then deletes it in the earlier version and is capable of carrying out these two version changes in a single migration (because the update phase will not find the field in question). It should be noted that this is not the standard case, field deletions being rare.
This phase will regenerate the code associated with the transactions that can be parameterized, once the database elements (and in particular in template screens) have been modified. This phase can be forced in certain version changes.
This phase completes miscellaneous parameters : default language, name of the folder, active modules, Web flag, current version, test folder, update of local menu for the analytical axes if their number changes... These are in general the parameters that cannot be modified by the user. Other updates can take place during this phase in the case of the folder creation (creation of at least one user, initialisation of the sequence number counters, creation of the first financial years and periods...).
The user menus are regenerated in all the languages used in the folder : that of the administrator is carried out from the functions table that could have changed, those of the users are simply purged of the functions that no longer exist. It should be noted that the users other than the administrator do not benefit, for security reasons, from the new functions created during update.
In the same way, a sequential file is created per language, containing the local menus. This file is loaded at the time of the connection to the client workstations (this generation is made just before the validation of the screens in the case where the folder is managed for the Wed).
In this phase, the PARAM.ini files and version.inf that contain the folder parameters and the current version number are created in the folder directory on the application server.
In this phase, the table containing the application locks (APLLCK) is emptied, the flags used during the update are updated, the folder parameters are updated with the new version number, the mode returns to multi-user and finally the validation log file is displayed if not in batch mode.
The error methods likely to occur are extremely varied and it is impossible to establish an exhaustive list. These errors are shown in the validation log file. Not all are serious (for example, not being able to revalidate a screen because of lack of space simply means it will be necessary to manually revalidate the screen). But in any case, it is necessary to seriously examine the validation log and all the errors found before restarting the live use.
In the case of a serious error, it is possible that the folder is in an incoherent state that prevents its usage and even a connection to it, the folder being locked. It is then possible to unlock the folder with the corresponding maintenance function, but it is necessary to be aware that this operation only momentarily unblocks the situation in order to allow a diagnostic connection. In fact, it should only be considered if the folder can be used normally again. The procedure to be followed is them to resolve the problem at the origin of the incident (for example this could be a lack of disk space) and to relaunch the validation, which will normally restart where it was stopped. In the worst case situation, it will be necessary to reload the backup, which should have been created before starting the validation.