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: Deleting links when no Link Attribute value present
Topic Summary: Get error: -R-E- DXL: <Line:88> cannot delete Link: no access to source object
Created On: 12-Jun-2008 00:29
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 Tony Goodman, on Thursday, June 12, 2008 4:54 PM

Answer:
My first hunch - calling delete(Link) only marks the link for deletion. The link does not actually get deleted until after the script has completed, or untill you call flushDeletions().

Try adding flushDeletions() after the call to delete(l) and see if that makes any difference.

Also, link handles do not seem to persist outside of the for l in o->"*" do loop.
 12-Jun-2008 00:29
User is offline View Users Profile Print this message


jason haury

Posts: 39
Joined: 20-Feb-2007

I've written a batch Link By Attribute tool which takes in a batch file with the same settings one inputs with DOORS native LBA tool. It also has the ability to delete links if a link is present, but a value in the corresponding LBA is not present.

I decided to revamp my code by moving some functions from my tool to a library file. Now things don't work right and I'm having trouble debugging. Here's the gist:

The main tool pops up a GUI where the user points to a batch file (a CSV file). It also lets the user choose how to handle links w/o LA (link attribute)values (0 = defer to a boolean flag that's part of the batch file, 1 = delete the links no matter what, 2 = preserve links no matter what). After getting the file path and settings from the user, it reads the file and sends it off to batchMakeLinks(linkListStr, checkLinksInt)

this function basically parses through each line of the batch file, grabs the parameters (source module, target, link mod, LA name, LA location (source mod or target), and the boolean flag of how to handle links with "missing" LA values). It does a lot of sanity checks then calls:
void makeLinks(string sourceStr, string targetStr, string linkModuleName, string LAStr, string LALoc))

makeLinks() works just fine. The next function it calls depending on how missing LA values are to be handled is:
int checkLinks(string sourceStr, string targetStr, string linkModuleName, string LAStr, string LALoc, bool deleteMissingLinks, bool useFilter)

If I write a separate little script that opens the source and target modules then calles checkLinks() directly, it works perfectly (deletes links where appropriate. However, when this function is called within the context of batchMakeLinks, i get the following error:
-R-E- DXL: <Line:88> cannot delete Link: no access to source object

Here, line 88 is the final line of my main script that brings up the GUI (the "show bLBAdb" line. Also, this error shows up after the entire script has run. You can see in the attached code that I specifically check to see if a link is deletable before trying to delete it, and the output I get suggests that it is deletable. However, for each "missing link" in my set of modules noted in the batch file, i get one error in the DXL window after all other output is printed by my script.

Any guesses why this function works when called directly, but not from within another function?

jason
Report this to a Moderator Report this to a Moderator
 12-Jun-2008 11:47
User is offline View Users Profile Print this message


Tony Goodman

Posts: 97
Joined: 6-May-2008

Answer Answer
My first hunch - calling delete(Link) only marks the link for deletion. The link does not actually get deleted until after the script has completed, or untill you call flushDeletions().

Try adding flushDeletions() after the call to delete(l) and see if that makes any difference.

Also, link handles do not seem to persist outside of the for l in o->"*" do loop.

-------------------------
Tony Goodman
Smart DXL limited
www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 12-Jun-2008 13:13
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Yes if you do not call flushDeletions after a delete, even if you then save, the link will not be deleted until the script finishes.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 12-Jun-2008 17:16
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You cannot delete links inside a normal "for lnk in o" loop; it messes up the loop and you'll get a variety of odd errors. Instead of deleting the link put it in some sort of skpLinksToDelete. After the main loop then loop through the Skip deleting the links.

You should also surround the delete(lnk) command with noError and lastError, in order to gracefully handle any errors.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.