If you create a link without setting up linkset pairings, DOORS will use the default link module. This causes problems when trying to analyse links if your links are not where you expect them to be.
To prevent the default link module being used, you need to place a soft-deleted DOORS Links module in every folder of your project. This will ensure that users can only create links as intended, and specified in your linkset pairings.
The following script will create, and soft-delete, a DOORS Links module in every folder below the current folder.
// Create and Soft delete DOORS Links module in current folder and all sub-folders /* Creates and Soft deletes a "DOORS Links" link module in the current folder and all sub-folders. If any DOORS Links modules already exist but are not soft-deleted, these are reported but the modules are left untouched. These modules should be renamed manually and then run this script again. Reports an error if a module cannot be created due to access permissions. Output is to the DXL interaction window. Tony Goodman tony@smartdxl.com */ pragma runLim, 0 string DOORS_LINKS = "DOORS Links" int existsCount = 0 int newCount = 0 int folderCount = 0 int errors = 0 /*********************************** createDoorsLinksModule ************************************/ void createDoorsLinksModule(Folder f) { Item i folderCount++ if (module(fullName(f) "/" DOORS_LINKS)) { if (!isDeleted(module(fullName(f) "/" DOORS_LINKS))) { existsCount++ print("Already exists (undeleted): " fullName(f) "/" DOORS_LINKS "\n") //softDelete(module(fullName(f) "/DOORS Links")) } else { //print "already deleted\n" } } else { (current FolderRef__) = f noError Module m = create(DOORS_LINKS, "DO NOT UNDELETE OR PURGE", manyToMany, false) res = lastError if (res "" != "") { errors++ print("Error trying to create " fullName(f) "/" DOORS_LINKS ": " res "\n") } if (!null m) { close(m) softDelete(module(fullName(f) "/" DOORS_LINKS)) newCount++ } else { errors++ print("Failed to create: " fullName(f) "/" DOORS_LINKS "\n") } } for i in f do { if (type(i) == "Folder" || type(i) == "Project") { createDoorsLinksModule(folder(fullName(i))) } } } /************************************ MAIN *************************************/ if (!confirm("You are about to create and soft-delete \"" DOORS_LINKS "\" modules in all folders below\n" //- fullName(current Folder) "\n" //- "Are you sure you want to continue?")) { halt } createDoorsLinksModule(current Folder) refreshDBExplorer() print(folderCount " folders checked\n") print(newCount " modules created and soft-deleted\n") print(existsCount " modules found (undeleted)\n") print(errors " errors (unable to create module)\n")