![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Following Links through many levels Topic Summary: Created On: 27-Jul-2005 22:43 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||
I have a script to extract data from DOORS to a text file with information about the current requirement and then follow links and get information about each linked object. Problem is I need to follow the links sometime 7-8 levels deep.
Currently I am doing sothing like this:
This takes me two levels deep, is there another follow the links until there are no more links to follow without endless nested loops. Seems like there must be an easier way, but I have yet to find it.
Edited: 27-Jul-2005 at 22:44 by Leonard Becraft |
|||
![]() |
|||
![]() |
|||
The attached loops around itself until there are no more paths to follow, following all incoming links. You can use this as a starting point for your own script.
Regards, Roy Bond MTU Aero Engines Munich
|
|||
![]() |
|||
![]() |
|||
Recursive is the way to go.
If your links are recursive (a links to b links to c links to a) then these loops will fail since making an inner loop from the same object will screw up any outer loop for that same object. Also, it will make your function run into infinity. Such a recursive function should probably have a non-recursive wrapper function that creates a Skip list of all traversed objects. The inner (recursive) function checks the Skip to make sure it hasn't already dealt with this object. If so it returns. If not it puts the object in the Skip and then loops through it. The outter function (callable from user programs) deletes the Skip when done. - Louie |
|||
![]() |
|||
![]() |
|||
Recursive is the way to go.
If your links are recursive (a links to b links to c links to a) then these loops will fail since making an inner loop from the same object will screw up any outer loop for that same object. Also, it will make your function run into infinity. Such a recursive function should probably have a non-recursive wrapper function that creates a Skip list of all traversed objects. The inner (recursive) function checks the Skip to make sure it hasn't already dealt with this object. If so it returns. If not it puts the object in the Skip and then loops through it. The outter function (callable from user programs) deletes the Skip when done. - Louie |
|||
![]() |
|||
![]() |
|||
Roy,
Thanks for you reply. I tried your script and it runs without errors, but the report is empty. Any ideas?
|
|||
![]() |
|||
![]() |
|||
Louie, Can you show me a small example? I am a novice at DXL scripts. Thank you!
|
|||
![]() |
|||
![]() |
|||
First - I am surprised you did not get an error when running the script as I simply copied it from our library without modification, and I am sure it makes reference to a Link Module Attribute which will not exist in your database!
See line 116 of the script .. lm1."Reverse Link Name" You could simply replace this with a string which gives the current Link Module name, or simply delete it! This may be why you get no output (but I more expected you to get a DXL error). If this doesn't work - email me directly at: roy-david.bond@muc.mtu.de Roy. |
|||
![]() |
Telelogic DOORS
» DXL Exchange
»
Following Links through many levels
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.