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: How to delete object with children
Topic Summary:
Created On: 13-Sep-2002 16:59
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.
 13-Sep-2002 16:59
User is offline View Users Profile Print this message


Hong Zhang

Posts: 29
Joined: 12-Sep-2002

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
}Text
Report this to a Moderator Report this to a Moderator
 16-Sep-2002 15:46
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
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.