As explained below, if the current KB contains modules that are inconsistently modularized, and you save the KB, G2 requires that the entire current KB and all its modules be saved into one KB file. In this case, the KB file contains knowledge about more than one module.
When loading a KB, G2 does the following:
top:
![]() |
No matter how many modules directly require a particular module, G2 loads that module only once.
Loading Modularized KBs and Detecting Conflicts
After you direct G2 to load a modularized KB, as G2 loads the modularized KBs that form a particular module hierarchy, G2 actually performs one load operation and one or more merge operations. First, G2 loads the KB whose module requires no other modules, then G2 merges one or more KBs into the current KB.automatically resolve conflicts box in the Load KB dialog.
Tip: For information on whether to select the automatically resolve conflicts check box and how to respond to a conflict workspace, see Detecting Conflicting Class Definitions.
Loading a Particular Version of a KB File
Your application development team might work with different versions of the same KB file, with each version stored in different directories. If a KB directly requires a module located in a particular version of another KB, you can use either of two techniques to ensure that a particular KB file is loaded:
By default, G2 looks for a KB file with the same name as the directly required module. For example, if you load a KB that contains a module named
top, and top directly requires another module named classes, then G2 attempts to find the module by searching for and loading a KB file named classes.kb in the same directory where the KB file containing the module top resides.
Merging a Modularized KB into the Current KB
Merging any KB file means to read a stored KB and to add its knowledge to the current KB. You can merge any KB into the current KB.
To merge a KB interactively:
Select Main Menu > Merge KB.
merge in this KB option in the save KB workspace.
To merge a KB programmatically:
Invoke the g2-merge-kb system procedure, as described in the G2 System Procedures Reference Manual.
Installing System Tables of a Merged Modularized KB
When you merge a KB, you can either install or not install its system tables into the current KB. Installing the system tables of a merged KB causes the module described in the Module Information system table of the merged KB to become the top-level module in the resulting current KB. merge in this KB and install its system tables check box, as shown in this figure:
![]() |
If you merge a modularized KB without installing its system tables, the resulting KB contains the merged modules, but they may not participate in the current KB's module hierarchy.
![]() |
Because the resulting KB has no top-level module, the merged modules are not directly required, and the resulting KB is inconsistently modularized.
When G2 ignores merging a module in this fashion, G2 places a message on the Operator Logbook, such as the follows:
![]() |
In this example, if your current KB is modularized and contains the module
uilroot, and you merge another KB whose top-level module classes also directly or indirectly requires a module named uilroot, G2 does not attempt to merge another KB, which may be located in the same directory, and which also contains a module named uilroot. Merging a Particular Version of a KB
As explained in Loading a Particular Version of a KB File, you can also merge a particular version of a KB by defining a module search path or creating a module map file.
For more information, see Using a Module Search Path to Load KB Files and Using a Module Map File to Load and Save a KB.