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: Link Attributes
Topic Summary: Reading the Target Object ID for a linked object.
Created On: 28-Sep-2004 09: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.
Answer This question was answered by Tony Goodman, on Friday, October 29, 2004 10:13 AM

Answer:
When you open a module, the link modules it "uses" are opened automatically, giving you access to the link objects.

You can get a handle on links using a loop and then get the source and target object absolute numbers as follows, without opening the other modules.

Link l
Object o = current

for l in o->"*" do
{
print "Source = " sourceAbsNo(l) "\n"
print "Target = " targetAbsNo(l) "\n"
}


Note that the DXL manual entries for sourceAbsNo() and targetAbsNo() functions are wrong.

 28-Sep-2004 09:59
User is offline View Users Profile Print this message


Mark Whalley

Posts: 8
Joined: 19-Jul-2004

If I have an open module and am looking at an object which has a
link, a right click on the link will tell me the Name of the linked
module and, the Object text (if the target module is open) or the
Object ID (if the target module is not open).

If I 'look at' the same information using a DXL script, the Object
handle is returned as NULL if the module is closed. This means that
the Object ID is not available :-(

The comment in the DXL manual is that if I have a link to a module
which isn't open, I will need to open the module it if I want any
information other than the module name.

When I use this solution (and open the target module) and then use
the "Absolute Number" attribute to find out the same information - it
takes nearly 15 seconds. I know that this is because I am opening the
target module and it is a big module but even so !!

Does anyone know of a way to interrogate a link, to find out what the
target object number is without opening the target module as well?



Thanks (in advance)

Mark




-------------------------

I used to have an open mind ... but my brains kept falling out!
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 14:54
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Don't know any way. But be sure to open the target module invisible; use "false" instead of "true":
mod = read(NameTarget, false). Invisible modules don't take anywhere near as long to load. Only open modules visible if you intend the user to see them.

- Louie
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 15:09
User is offline View Users Profile Print this message


Mark Whalley

Posts: 8
Joined: 19-Jul-2004

Done that - I'd guessed that not displaying might speed things up but it's still far too slow. The thing that's puzzling me is that Doors can do it in normal operation mode (without having to open the target module) - so how is it done?

Mark

-------------------------

I used to have an open mind ... but my brains kept falling out!
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 15:43
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

You can use the function:

int targetAbsNo(Link l)

to get the Absolute Number of the target of a link, without opening the modue.
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 15:44
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Answer Answer
When you open a module, the link modules it "uses" are opened automatically, giving you access to the link objects.

You can get a handle on links using a loop and then get the source and target object absolute numbers as follows, without opening the other modules.

Link l
Object o = current

for l in o->"*" do
{
print "Source = " sourceAbsNo(l) "\n"
print "Target = " targetAbsNo(l) "\n"
}


Note that the DXL manual entries for sourceAbsNo() and targetAbsNo() functions are wrong.



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 15:53
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Don't know how DOORS knows. I poked around with the "link attributes" and noticed the standard ones apply to the link-sets and the Created By and Modified By ones also apply to links; but the Source and Destination ones are for the linkset only. Didn't find one that means "This Link's target object".

- Louie
Report this to a Moderator Report this to a Moderator
 28-Sep-2004 16:10
User is offline View Users Profile Print this message


Mark Whalley

Posts: 8
Joined: 19-Jul-2004

Antonio and Tony,
Thanks for the suggestion - it worked !!

I didn't try AbsNo because the DXL manual implied it would return a value for the module rather than a value for an object within a module ...

targetAbsNo
Declaration int targetAbsNo(Link l)
Operation Returns the absolute number of the module that is the target of l.

Mark

-------------------------

I used to have an open mind ... but my brains kept falling out!
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.