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 do you count the number of links in a linkset?
Topic Summary:
Created On: 6-Mar-2003 18:51
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 T.J. Theodore, on Friday, March 7, 2003 5:35 PM

Answer:
As it turns out, I was counting linksets in the link module when I thought I was counting links. You have to open the source formal module once you know the source and target ends of the linkset and then look for links in the formal module matching the linkset pair. I could probably do this more efficiently using skiplists, but here is one method that works for counting all links in a project by linkset.

Regards,

T.J.
 6-Mar-2003 18:51
User is offline View Users Profile Print this message


T.J. Theodore

Posts: 2
Joined: 23-Dec-2002

I have a script that all are welcome to use which writes all of the link modules and linkset pairs to a csv file for the currently selected project. It should work for DOORS 5.x and higher. The problem I am trying to solve is in lines 42-44 of the file where I try to count all of the links in the linkset. Any help is much appreciated.
Report this to a Moderator Report this to a Moderator
 6-Mar-2003 19:25
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

T.J.,

In your listLinksets() function, you are looping through objects in a link module. Each one of these objects represents a link. They themselves are not linked to, so the construct:

for lnk in o <- "*" do

will not work, and is not supposed to work, for link objects. That construct is for objects in a formal module.

If you just want to count the links, just count the number of link objects in the link module.

The link object can reveal attributes of the link, such as:

o."Source"
o."Target"

which are the source and target modules for the link. Put together, that essentially gives you the "linkset" ( source -> target ) pairing.

Also, you are setting "numLinks = 0" INSIDE the loop. That is a bad thing.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com

Edited: 6-Mar-2003 at 19:29 by Michael Sutherland
Report this to a Moderator Report this to a Moderator
 6-Mar-2003 19:53
User is offline View Users Profile Print this message


Mark Phillips

Posts: 40
Joined: 17-Dec-2002

T.J.

Michael was quicker on the draw than me, but you might also consider changing line 55 from:

for itm in all f do {

to:

for itm in current Project do {

This will recursively list all items in the project (or so it seems in the code I am currently working on).

Mark

-------------------------
Mark Phillips
mark.phillips@swri.org
Report this to a Moderator Report this to a Moderator
 7-Mar-2003 17:35
User is offline View Users Profile Print this message


T.J. Theodore

Posts: 2
Joined: 23-Dec-2002

Answer Answer
As it turns out, I was counting linksets in the link module when I thought I was counting links. You have to open the source formal module once you know the source and target ends of the linkset and then look for links in the formal module matching the linkset pair. I could probably do this more efficiently using skiplists, but here is one method that works for counting all links in a project by linkset.

Regards,

T.J.

Edited: 7-Mar-2003 at 21:15 by T.J. Theodore
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.