![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() 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. | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.