Analyze source code during a Universal Importer import
Overview
Some repositories, for example in an ERP, hold both the hierarchy of objects with their properties and the source code of some of those objects. The Universal Importer can handle both in a single job: it imports the objects, links and properties from the .uax files, and runs the Universal Analyzer on the source code that the .uax files reference.
A Universal Analyzer language package for the language must be installed, with a language pattern that can analyze the source code.
Reference the source code of an object
For each object whose source code must be analyzed, add two elements to its instance in the .uax file:
| Element | Description |
|---|---|
CAST_CodeExpandable/@sourcePath |
The path of the file that contains the source code of the object. |
CAST_UA_CodeExpandable/@technologies |
The Universal Analyzer language of the source code, as named in the language package. |
For example, for a PeopleSoft page event:
<instance id="PageEvent.1" instanceOf="PSoft_PageEvent">
<identification name="ACL_COMPONENT2.Activate" fullName="ACL_COMPONENT2.Activate"/>
<CAST_CodeExpandable sourcePath="PageEvent_ACL_COMPONENT2.Activate.src.PSoft_PageEvent.ACL_COMPONENT2..Activate"/>
<CAST_UA_CodeExpandable technologies="PeopleSoft"/>
</instance>
The referenced file contains the source code of the object, in the form that the language pattern expects:
CAST_EXPORTED_PEOPLECODE_PAGE_BEGIN
NAME=ACL_COMPONENT2.Activate
FULLNAME=ACL_COMPONENT2.Activate
BEGIN_PEOPLECODE
Local Grid &grid;
grid = GetGrid(Panel.ACL_COMPONENT2, 'ACLCOMPONENT_V2');
&column = &grid.GetColumn('VIEW_CREF');
&column.Label = MsgGetText(48, 274, 'Message Not Found');
END_PEOPLECODE
CAST_EXPORTED_PEOPLECODE_END
Relative and absolute paths
sourcePath can be relative or absolute:
| Path | Example |
|---|---|
| Relative | PageEvent_ACL_COMPONENT2.Activate.src.PSoft_PageEvent.ACL_COMPONENT2..Activate |
| Absolute | P:\PageEvent\PageEvent_ACL_COMPONENT2.Activate.src.PSoft_PageEvent.ACL_COMPONENT2..Activate |
Use relative paths. They are resolved from the root path of the import, so they keep working when the delivered files move.
Do not combine separate jobs
Older releases imported such repositories with two separate jobs, a Universal Analyzer job and a Universal Importer job, on the same objects. Do not use this combined mode: the objects are attached to two sets of projects and are counted twice, so the dashboards report more total checks than there are objects. Use a single Universal Importer job as described on this page.