Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Louie Landale, on Friday, September 22, 2006 3:08 PM

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
 20-Sep-2006 13:27
User is offline View Users Profile Print this message


Craig Forant

Posts: 56
Joined: 21-Feb-2005

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
Report this to a Moderator Report this to a Moderator
 20-Sep-2006 22:15
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer 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
Report this to a Moderator Report this to a Moderator
 22-Sep-2006 15:12
User is offline View Users Profile Print this message


Craig Forant

Posts: 56
Joined: 21-Feb-2005

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.