On this page:
Target audience:
CAST Administrators
.UAX files
The .UAX that contain the link definitions must conform to a pre-defined format that can be understood by the Universal Importer. Links between object that you would like to import are described as instances using categories inherited by type: the types and categories are already defined in CAST's default metamodel for each supported technology (see the relevant XXXMetaModel.xml file file in the configuration\Languages folder in your CAST installation).
The instances do not have to respect any order.
Note that you should not define parent relationships (via "parentLink" type) when using "externalXXX" properties. This will lead to inconsistent results. It is also not possible to define Foreign Keys, Constraints, or Common Keys in this way.
.UAX files must be encoded in UTF-8 format as follows:
<?xml version="1.0" encoding="UTF-8"?>
Therefore please ensure that you save the files in your text editor using the correct format:
Example .UAX file for importing links
The following .UAX file creates a Call link as follows between objects that exist in the CAST Analysis Service already (created via a standard CAST Analyzer):
- From an object I_Invoice (Stored Procedure) to an object Invoice_Line
<?xml version="1.0" encoding="UTF-8"?> <instances> <!-- Here we create the link between the two objects in the CAST Analysis Service --> <instance id="call" instanceOf="callLink"> <link caller="I_Invoice" callee="Invoice_Line" /> </instance> <!-- Here we identify the two objects in the CAST Analysis Service --> <!-- A special "uaxDBRef" instance is created to simulate the objects in the CAST Analsysis Service --> <instance id="Invoice_Line" instanceOf="uaxDBRef"> <identification name="Invoice_Line" fullName="default.CASTPUBS.dbo.Invoice_Line" /> </instance> <instance id="I_Invoice" instanceOf="uaxDBRef"> <identification name="I_Invoice" fullName="default.CASTPUBS.dbo.I_Invoice" /> </instance> </instances>
When importing this .UAX file into the CAST Analysis Service using the Universal Importer, the following results will appear in CAST Enlighten:
Before running the Universal Importer:
After running the Universal Importer - an new Call link is displayed between the two objects:
CodeAndCommentsChecksum and CodeOnlyChecksum
If you define checksum values for an instance using the CodeAndCommentsChecksum and CodeOnlyChecksum attributes in the <checksum> tag as shown below, then you must ensure that the values are decimal ONLY. If you use a hexidecimal value (for example), the value will not be interpreted correctly by the Universal Importer.
<instance id="WPDi60000KY0M" instanceOf="GTpackage"> <identification name="accntng" fullName="Package - $accntng"/> <persistent guid="package.accntng"/> <checksum CodeAndCommentsChecksum="456987" CodeOnlyChecksum="687456"/> </instance>
CAST Analysis Service databases tables
It is possible to output the external analyzer results directly into two dedicated Analysis Service tables and then use the Universal Importer to transfer link definitions into the Analysis Service so that they can be exploited with CAST Enlighten (for example).
The two tables are:
- UAX_IMPORT_INSTANCES
- UAX_IMPORT_PROPERTIES
These tables will automatically be created during the installation of the Analysis Service.
- Please note that in each of these two tables, there is a column called "GROUPNAME": you can use this column to group together data that you want to import (for example the results of a specific analysis). The Universal Importer wizard allows you to select data for import according to the GROUPNAME column (see Import additional links to enrich existing data generated by CAST Analyzers).
- For Oracle users, please don't forget to do a COMMIT after inserting data into the tables in order to ensure that you have the latest data.
UAX_IMPORT_INSTANCES
This table contains the following columns:
UAX_IMPORT_INSTANCES |
|
|
GROUPNAME | Varchar(255) | Name of the data group |
INSTANCE_ID | Varchar(255) | Unique ID of instance (object or link) |
INSTANCE_TYPE | Varchar(100) | Instance Type (object or link) |
This table is used to describe the instances that you want to import (i.e. the objects or links). The instance ID is entered here, as well as the instance type (that corresponds with the type name specified in the metamodel file that forms part of the language pack for your language).
Please note that contrary to a file-based import, you must make sure that you give an ID to links.
When configuring your external analyzer, you must make sure that all columns are filled in. Note also that NULL columns are not accepted.
UAX_IMPORT_PROPERTIES
UAX_IMPORT_PROPERTIES |
|
|
GROUPNAME | Varchar(255) | Name of the data group |
INSTANCE_ID | Varchar(255) | Unique ID of instance |
CATEGORY | Varchar(100) | Category in which the property is defined |
PROPERTY_NAME | Varchar(100) | The name of the property |
VALUE | Varchar(1000) | Value of the property |
This table is used to describe the properties of each instance (i.e. the properties of each link and object). For each property, you must define the following:
- The ID of the instance to which the property is associated
- The name of the instance to which the property is associated
- The name of the property
- The value of the property - this is in the form of a character string: as in the .UAX files, the values are interpreted according to their type (for example, the value of a numerical property with be automatically converted into an integer)
Equivalence between file and table import
This section shows how an example .UAX file would be translated into the SQL tables.
Example .UAX file
The following .UAX file is equivalent to the SQL tables shown in the Example SQL tables section below (this uses the same example of creating a link between two objects in the CAST Analysis Service):
<?xml version="1.0" encoding="UTF-8"?> <instances> <instance id="call" instanceOf="callLink"> <link caller="I_Invoice" callee="Invoice_Line" /> </instance> <instance id="Invoice_Line" instanceOf="uaxDBRef"> <identification name="Invoice_Line" fullName="default.CASTPUBS.dbo.Invoice_Line" /> </instance> <instance id="I_Invoice" instanceOf="uaxDBRef"> <identification name="I_Invoice" fullName="default.CASTPUBS.dbo.I_Invoice" /> </instance> </instances>
Example SQL tables and Universal Importer script
The above .UAX file would be represented in the SQL tables as follows ("GROUPNAME" = TEST, link IDs = type-caller-callee):
UAX_IMPORT_INSTANCES |
|
|
GROUPNAME | INSTANCE_ID | INSTANCE_TYPE |
TEST | call | callLink |
TEST | Invoice_Line | uaxDBRef |
TEST | I_Invoice | uaxDBRef |
UAX_IMPORT_PROPERTIES |
|
|
|
|
GROUPNAME | INSTANCE_ID | CATEGORY | PROPERTY_NAME | VALUE |
TEST | call | link | caller | I_Invoice |
TEST | call | link | callee | Invoice_Line |
TEST | Invoice_Line | identification | name | Invoice_Line |
TEST | Invoice_Line | identification | fullName | default.CASTPUBS.dbo.Invoice_Line |
TEST | I_Invoice | identification | name | I_Invoice |
TEST | I_Invoice | identification | fullName | default.CASTPUBS.dbo.I_Invoice |
The script required in the Universal Importer to populate the tables would be as follows:
insert into §UAX_IMPORT_INSTANCES (GROUPNAME, INSTANCE_ID, INSTANCE_TYPE) values ('$(GROUPNAME)', 'call', 'callLink') / insert into §UAX_IMPORT_INSTANCES (GROUPNAME, INSTANCE_ID, INSTANCE_TYPE) values ('$(GROUPNAME)', 'Invoice_Line', 'uaxDBRef') / insert into §UAX_IMPORT_INSTANCES (GROUPNAME, INSTANCE_ID, INSTANCE_TYPE) values ('$(GROUPNAME)', 'I_Invoice', 'uaxDBRef') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','call', 'link', 'caller', 'I_Invoice') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','call', 'link', 'callee', 'Invoice_Line') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','Invoice_Line', 'identification', 'name', 'Invoice_Line') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','Invoice_Line', 'identification', 'fullName', 'default.CASTPUBS.dbo.Invoice_Line') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','I_Invoice', 'identification', 'name', 'I_Invoice') / insert into §UAX_IMPORT_PROPERTIES (GROUPNAME, INSTANCE_ID, CATEGORY, PROPERTY_NAME, VALUE) values ('$(GROUPNAME)','I_Invoice', 'identification', 'fullName', 'default.CASTPUBS.dbo.I_Invoice') /