Show source code and calculate metrics for imported objects
Overview
Objects imported with the Universal Importer have no source code position by default, so their code cannot be displayed and no metrics are calculated on them. This page lists the links and properties to add to the .uax files to enable both.
Display source code
Three conditions must be met for each imported object. In the examples, the object proc_B is defined in the file C:\test.pli.
-
An
isInSourceLinkmust link the object to the file that contains it. Each file must also have anisInSourceLinkto itself:<instance id="" instanceOf="isInSourceLink"> <link caller="proc_B" callee="test.pli"/> </instance> -
The object must inherit from the
bookmarkcategory, and itssourceproperty must contain the path of the file:<bookmark source="C:\test.pli"/> -
The object must inherit from the
POSITIONABLEcategory, and itsPOSITIONSproperty must contain the name of the file followed by the position of the object: start line, start column, end line and end column:<POSITIONABLE POSITIONS="test.pli(122,10,144,13) "/>
The source code can then be displayed, but with a warning that the file may no longer be synchronized with the repository. To avoid this warning, give each file the date it was last modified, in the lastModifiedDate property of the synchronizable category. The values are the year, month, day, hour, minute and second:
<synchronizable lastModifiedDate="(2006,11,22,14,43,46)"/>
Calculate metrics
Three conditions must be met for metrics to be calculated on an imported object:
- The object type must inherit from the
METRICABLEcategory in the metamodel. - An
isInSourceLinkmust link the object to its file, as described above. - The
sourceproperty of thebookmarkcategory must contain the path of the file, as described above.