![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Restoring links to new objects from Purged Objects Topic Summary: Need a DXL that will save links info for restoring later in script. Created On: 20-Sep-2006 13:27 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: You can trap softDelete errors like this: noError() softDelete(TmpObj) string ErrMess = lastError() if (!null ErrMess) then deal with the error. That construct should be routine for lots of calls that abort DXL on error. You may want an "if (!isEdit(n)) then error: module not open Exclusive " line at the top of your function. You should be able to loop through the outgoing links of a soon-to-be purged objects, storing in a skip list the name of the link module and the Object handle of the target object. When you figure out the Object handle of the replacement object, loop through the Skip reestablishing the links. You'll have to make sure the target module is already open (DXL has examples for that), and that it STAYS open until you establish the links. The above method presumes that you find the links and establish the links before moving on to the next object subject to purge. If you want to capture all the links from such objects, purge them, THEN reestablish then links it gets stickier. I'd probably use nested Skip lists but that's hard to explain. The other method would be to use an Array with 3 dimensions, source Object, string NameLinkMod, and target Object. - Louie | |
![]() |
|
We are currently running a script that imports Test Cases and their steps into a module as Parent and Child objs (steps are children of main TC description obj) and links them to imported defects in another module or links to a testing summary obj in same module. Then users link these manually to our Requirements.
When TC Export is re run for updates, if there are changes to a TC the script runs DeleteSteps function to delete TC's obj and all steps (child objs). It then proceeds to re-write TC as new totally objects. The problem exists if links are present in objs. I think I can delete links through specific link module (the ones that will be recreated automatically by original script) but the problem is in needing to preserve links through unknown link modules and reattaching to newly created object. Any input will be appreciated. Thanks. FYI: Code attached is our DeleteSteps function. If links exist, it fails on softDelete line. ------------------------- Craig Forant me@craigforant.com Edited: 20-Sep-2006 at 14:13 by Craig Forant |
|
![]() |
|
![]() |
|
You can trap softDelete errors like this:
noError() softDelete(TmpObj) string ErrMess = lastError() if (!null ErrMess) then deal with the error. That construct should be routine for lots of calls that abort DXL on error. You may want an "if (!isEdit(n)) then error: module not open Exclusive " line at the top of your function. You should be able to loop through the outgoing links of a soon-to-be purged objects, storing in a skip list the name of the link module and the Object handle of the target object. When you figure out the Object handle of the replacement object, loop through the Skip reestablishing the links. You'll have to make sure the target module is already open (DXL has examples for that), and that it STAYS open until you establish the links. The above method presumes that you find the links and establish the links before moving on to the next object subject to purge. If you want to capture all the links from such objects, purge them, THEN reestablish then links it gets stickier. I'd probably use nested Skip lists but that's hard to explain. The other method would be to use an Array with 3 dimensions, source Object, string NameLinkMod, and target Object. - Louie |
|
![]() |
|
![]() |
|
Thanks Mr. Landale. You always have great advice. First things first, the DXL WAS failing when someone else had the module open, so the if isEdit line will come in handy. As for the main problem, we will probably take the skip list approach. I will post the code when it is complete for others to see our final solution.
Thanks for your help. ------------------------- Craig Forant me@craigforant.com |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.