Cross references, or links, are used to connect items in the database. Each cross reference connects two items. A cross reference represents the fact that the two items are related in some way. Sometimes, it is helpful to load cross reference links en masse from an external file.
Types of File to Load
Cradle can load data from files in three main formats:
- Cradle
- CSV / TSV, comma separated value or tab separated value
- XML, there are many possible dialects of XML
Microsoft Excel® can easily produce CSV files. Also, it is easy to work with collections of simple data in Excel. Therefore, we recommend that you use Excel to load cross reference links into Cradle using CSV files.
Example
In this blog entry, we will assume that you want to load cross reference links between user-defined items, such as system requirements and verifications, or test cases to test results. So, if you want to do anything else, please look in the reference section below for links to the Cradle help.
In our example, we will create links of type FRED from PROCR items to SR items.
Create Cross Reference Links
You will need the following columns in your Excel spreadsheet:
- Type, use the value: NOTE_NOTE
- Link Type, the link type of the cross references that you want to create. In our example, this is the link type: FRED.
- From Info Subtype, use the value: NULL_INFOSUB
- For From Model Namespace, use the value: MH_IGNOREMODEL
- From Number, this contains the Identity of the item at the from end of the cross reference. In our example, this is the Identity of the PROCR item.
- From Type, this contains the type of item at the from end of the cross reference. In our example, this is: PROCR.
- To Info Subtype, use the value: NULL_INFOSUB
- For To Model Namespace, use the value: MH_IGNOREMODEL
- To Number, this contains the Identity of the item at the to end of the cross reference. In our example, this is the Identity of the SR item.
- To Type, this contains the type of item at the to end of the cross reference. In our example, this is: SR.
These fields can be in any order.
Load Cross Reference Links
You can load the CSV file containing your links by:
- Select Import from the Project tab in WorkBench
- Set: File Type to be: CSV
- Then, set: Info Type to be: Cross References
- Also, set: Overwrite to be: Off, as this is safer than the other options(!)
- And set From file to be where your CSV file is stored
- Click Import
You will be asked to define the mapping between fields in the CSV file and the attributes of cross references. Because the column headings in Excel match the names of the attributes, everything is mapped automatically:
Click OK to load cross reference links from the CSV file.
Link Rules
The link rules defined in your schema are used to control if cross references will be imported from your CSV file. You can set an option to ignore your link rules, if you want to.
Dangling Links
Importing cross references this way may create dangling cross references. A cross reference is dangling if the item at its from end, or its to end, does not exist. Cradle allows you to import these cross references because it would be too restrictive to prevent you doing this.
You can detect and remove dangling cross references using the Cross Reference Integrity check in the Project tab in WorkBench.
Reference in Cradle Help
You can review the details of Cradle’s CSV file format in the Cradle help. Every Cradle system contains the Cradle help. You can access this help from the Help tab in every Cradle UI, and (on Windows) from the Cradle Help item in the Start menu.
We also provide the Cradle help on-line in our website:
https://www.threesl.com/cradle/help/
You can access the detailed help for Cradle’s CSV file format here:
https://www.threesl.com/cradle/help/7.3/Import%20Export/Other/csv_fileformat.htm