![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: How to delete object with children Topic Summary: Created On: 13-Sep-2002 16:59 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi everyone,
Can anybody tell me what's wrong with me code here? What I am trying to do is to delete some objects. The error message that I got was: -R-E- DXL: <Line:18> cannot delete Object: no access to source object -I- DXL: <Line:37> execution halted I have two Level 2 objects. One has children, got deleted by running the script. The other has not children, remain undeleted. Any help will be highly appreciated. Thanks!!! hong void deleteLeaf(Object node) { if (!leaf(node)) then { Object subtree for subtree in node do deleteLeaf(subtree) } if (leaf(node)) then softDelete node } ![]() |
|
![]() |
|
![]() |
|
Just a guess, but perhaps you have stumbled across a table. Be advised that in addition to "cells" there are also "table" objects and "row" objects; see DXL commands table/row/cell. If you run into a "table" object you can delete the entire table via the "deleteTable" command; you cannot "delete(obj)" a table, so perhaps that's why you are getting that message. You can check by inserting the following at the top of your function:
if (table(node)) print "Table found at " number(node) "\n" if (row(node)) print "Row found at " number(node) "\n" if (cell(node)) print "Cell found at " number (node) "\n" If I read the manual correctly, you may need to ignore "tables" and "rows" and simply wait until you find a "cell" before you issue the "deleteTable" command. You also need to be careful about deleting objects inside some sort of "for obj in mod" loop. So if your driver program is: for obj in mod do: { if I should delete this object then deleteLeaf(obj) } it will probably fail. Change it to: for obj in mod do: { if I should delete this object then put the object in a Skip list. } for obj in Skip List do { deleteLeaf(obj) } - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
How to delete object with children
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.