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: DXL utility to reorder links
Topic Summary:
Created On: 11-Mar-2004 16:33
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.
 11-Mar-2004 20:12
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You probably cannot change the actual order but you CAN change the order in which you display it. Algorithm may look like:

for each link
put the link handle and target absno in a Skip.

// Optionally put the Identifier in the Skip if links involve multiple target modules.

CurrentAbsNo = -1
while (!Done)
{ for each link in the Skip
find the smallest AbsNo that is Higher than CurrentAbsNo
if no such AbsNo exists then we are Done.
CurrentAbsNo = AbsNo
display information about this link
}

You can generalize the function if the CurrentAbsNo and Skip are global variables (used only by the following functions) and you write two functions; one that initializes the Skip, gets the links from the specific objects and stores them in the Skip; and the 2nd function retrieves the "next" link from the Skip (and updates CurrentAbsNo). These generallized functions allow the caller to do whatever she wants with the links.

I've done this Generalization using module names: got a function that gets the modules in the current folder and all sub-folders (it gets them in reasonable order) and puts them in a Skip. But the for module name in Skip loops seems to retrieve them irratically. So I inserted them into the Skip with an incremented Counter, and later I can retrieve them in inserted order.

- Louie
Report this to a Moderator Report this to a Moderator
 12-Mar-2004 15:35
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Don't know anything about the order of links found in the [1] for link in obj loop nor [2] displayed in the Edit Links dialog. I suppose, however, you could write a utility to capture all the links information, delete all the links, then recreate them in the desired order.

- Louie
Report this to a Moderator Report this to a Moderator
 23-Mar-2004 13:00
User is offline View Users Profile Print this message


Pieter DE WAARD

Posts: 73
Joined: 11-Jul-2003

Thanks Louie for your hint.

My need was to present data in module B, following links to module A, where the data presented is the module A Object ID concatenated with some other atrribute info from module A. As the link order is not (always) predictable, I wanted to at least present the data in some predictable order.

Following up on you hint I found that the Skiplist orders the data automatically in numerical order when the key is integer (using the Absolute Number from module A).

See the code below:

string s1 = "VAR-3000"
string s2 = "VAR-10"
string s3 = "VAR-200"
int absNoID
bool isendList = false
string singlelist
Regexp del = regexp "\n"
Regexp varid1 = regexp "[0-9]*[0-9]"

string s = s1 "\n" s2 "\n" s3 //Construct example string, representing link-based contents of an attribute

Skip idList = create

//Seperate Object IDs and put in Skiplist
while(!isendList)
{
// Strip out singlestrings seperated by CR/LF
if (del s)
{
singlelist = s [0:start 0-1]
s = s [start 0+1:]
}
else
{
singlelist = s
isendList = true
}
// Strip out integer from VAR-ID
if (varid1 singlelist)
{
absNoID = intOf(singlelist [start 0:end 0]) // Or use Absolute Number directly as in trg."Absolute Number"
put(idList,absNoID,singlelist)
print singlelist ": " absNoID "\n"
}

}

string varIDstr = ""
print "Result:\n"
for varIDstr in idList do
{
print varIDstr "\n"
}

delete(idList)


Input and AbsNo:

VAR-3000: 3000
VAR-10: 10
VAR-200: 200

Result:

VAR-10
VAR-200
VAR-3000


-------------------------
Pieter de Waard
www.nhindustries.com

Edited: 23-Mar-2004 at 13:18 by Pieter DE WAARD
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.