In order for the Code Viewer in CAST Enlighten (a feature that allows you to view the source code of objects and files stored in the CAST Analysis Service using a copy of the source code located on a local or network hard drive) and for the calculation of metrics data (on objects and files stored in the CAST Analysis Service for use with the CAST Engineering Dashboard) to function correctly with objects that have been imported into the CAST Analysis Service via the Universal Importer, certain criteria must be met.

This section explains what needs to be done in order to exploit both the Code Viewer and the metrics data with results of an analysis carried out with a non-CAST analyzer that have subsequently been imported into the CAST Analysis Service.

There is no difference in the following instructions for objects resulting from .UAX type files or for objects that have been fed into the UAX_IMPORT_PROPERTIES / UAX_IMPORT_INSTANCES tables.

Code Viewer

Three criteria are necessary for viewing the code of objects imported into the CAST Analysis Service with the Universal Importer:

  • An isInSourceLink link type must exist between each object and the file in which it is defined (in particular there must be a link of this type between the file and itself). This is so that the object is bound to a particular file. E.g.: If an object proc_B is defined in the file test.pli, the following link must exist:
<instance id="" instanceOf="isInSourceLink">
   <link caller="proc_B" callee="test.pli"/>
</instance>
  • The source property in the bookmark category must – for each object - contain the path of the file in which the object is defined (i.e. each object must inherit from the bookmark category). This is so that the Code Viewer can determine where the source code is stored on the local or network hard drive. E.g.: If an object proc_B is defined in the file test.pli whose path is C:\test.pli, then the definition of the object proc_B must contain the following line:
<bookmark source="C:\test.pli"/>
  • The POSITIONS property in the POSITIONABLE category must – for each object - contain the name of the file in which the object is defined followed by its positions (i.e. each object must inherit from the POSITIONABLE category). This is so that the Code Viewer can determine where the object is defined in the file itself. E.g.: If an object proc_B is defined in the file test.pli, then the definition of the object proc_B must contain the following line:
<POSITIONABLE POSITIONS="test.pli(122,10,144,13) "/>

If these three conditions are met, then the Code Viewer in CAST Enlighten will function correctly for objects imported with the Universal Importer.

However, the following error will be displayed in the Code Viewer:

file 'C:\test.pli' may be no longer synchronized with repository (based on source date)

This error indicates that the Code Viewer cannot establish whether the file on the local or network hard drive is synchronized with the file in the CAST Analysis Service. This will not stop you from using the Code Viewer to view the object's code, however, it is possible to avoid this type of warning by adding the lastModifiedDate property to the synchronizable category for each file, and then indicating the date of the last modification to the file, so that the Code Viewer can see that the last modification date of the file in the CAST Knowledge Base and the file on the local or network hard drive is identical.

E.g.: the file definition must contain a line as follows (where the numbers represent: year, month, day, hour, minute, second:

<synchronizable lastModifiedDate="(2006,11,22,14,43,46)"/>

Metrics data

As indicated in the Creating or modifying a custom extension using the CAST Universal Analyzer framework, objects must inherit from the METRICABLE category in order for metrics to be calculated on the object. In addition two further criteria must also be met:

  • An isInSourceLink link type must exist between each object and the file in which it is defined (in particular there must be a link of this type between the file and itself). This is so that the object is bound to a particular file.E.g.: If an object proc_B is defined in the file test.pli, the following link must exist:
<instance id="" instanceOf="isInSourceLink">
   <link caller="proc_B" callee="test.pli"/>
</instance>
  • The source property in the bookmark category must - for each object - contain the path of the file in which the object is defined (i.e. each object must inherit from the bookmark category). This is so that the Metrics Assistant can determine where the source code is stored on the local or network hard drive.E.g.: If an object proc_B is defined in the file test.pli whose path is C:\test.pli, then the definition of the object proc_B must contain the following line:
<bookmark source="C:\test.pli"/>

If these two conditions are met, then metric data will be generated for objects imported with the Universal Importer.