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 check if prefix already exists?
Topic Summary:
Created On: 29-Nov-2007 12:40
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.
 29-Nov-2007 12:40
User is offline View Users Profile Print this message


Mark Rietveld

Posts: 16
Joined: 6-Apr-2004

We would like to be sure that each module created in the repository has a unique prefix.

Anybody knows a solution for this?

For example a trigger starting a DXL script when a new module gets created?

Kind regards,

Mark
Report this to a Moderator Report this to a Moderator
 29-Nov-2007 15:49
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

The prefix is a module level attribute. You can access it easily. To save time, it might be best to keep a file out on your network somewhere with all the different prefixes. Your tool can read from it to check if the one you want is already used. Then append it when you want to set your new unique prefix.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 29-Nov-2007 17:37
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If you intend Prefixes to be unique then no doubt you want Module Names to be unique; at least within the same project. It would seem to be a bit of a bother to do that dynamically as new modules are created; and that method would get pretty clumsy if you created new modules with Restore, Rejoin, click-and-drag, or copy-and-paste.

I'd be tempted to have an on-demand script that checks all modules in the project and reports those with duplicate names or Prefixes.

Attached works tolerably.

- Louie
Report this to a Moderator Report this to a Moderator
 29-Nov-2007 18:32
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

One (really odd ;-) idea: module ID is unique in the database, each module could in principle have it's uniqueID as prefix. Of course this leads to prefixes as "000053ac" or such, but they would be unique.

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 29-Nov-2007 18:37
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Louie I was thinking a tool that you run from a new module, you type a Prefix into a text field, and then click a button to check if its already used. If not, it returns a dialog saying its available and asks if you want to assign it as the module prefix. It so, it tells you it's already taken.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 30-Nov-2007 10:16
User is offline View Users Profile Print this message


Mark Rietveld

Posts: 16
Joined: 6-Apr-2004

Originally posted by: David Pechacek

Louie I was thinking a tool that you run from a new module, you type a Prefix into a text field, and then click a button to check if its already used. If not, it returns a dialog saying its available and asks if you want to assign it as the module prefix. It so, it tells you it's already taken.


Yes, that would be great! In this way you have the freedom to use a meaningful prefix for a module, without having to worry if it already exists. Otherwise we need to introduce all kind of rules about how a prefix must look like. This together with a module-prefix overview would even be better.
Report this to a Moderator Report this to a Moderator
 30-Nov-2007 14:43
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Well the problem with it Mark depends on the version of DOORS you're running. If you're running 8.1 or prior, you can't get info on Modules without opening them. So that means for every module in the database, you'd have to open them to check the prefix. For 8.2 and 8.3, you can get the info without opening the module I believe. So it'd be far faster.

I might see about coding this up at home. Try to make it work for both new and older versions. Unless you already have.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 30-Nov-2007 15:25
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Such a tool should no doubt have the 'current project' as the scope. 'In the database' seems hopelessly unrealistic unless you have one database for each different project ..err.. I mean each different Program.

If you intend unique module Prefixes in the project then it seems you should have unique module names in the project as well; where the Prefix is simply the module name with an underscore suffix. This way, given an identifier reference, you can quickly and uniquely identify the module and the object. With this scheme, the Project admin decides the module names and the prefixes, not the person creating the module.

You could also perhaps have a policy where Prefixes that start or end with a specific string do not need to be unique. Thus the 'unique' requirement applies to 'official' modules such as Requirement module, Verification modules etc.

You can modify my code, since the g_skpPrefixes contains all the prefixes of modules in the project. When you get the suggested one you can search for it in the skip.

- Louie
Report this to a Moderator Report this to a Moderator
 6-Dec-2007 09:01
User is offline View Users Profile Print this message


Andrew Tagg

Posts: 151
Joined: 26-Oct-2004

You could create a module at the top level of the database to contain prefixes (one object per prefix, store prefix in the object text), then create an open module trigger to consult that module and compare the current prefix with the stored ones. At lease that way you could generate a warning at open time that this module is a duplicate.

-------------------------
Andrew Tagg
Thales Air Systems, Melbourne
Australia.
andrew.tagg@thalesatm.com
Report this to a Moderator Report this to a Moderator
 6-Dec-2007 09:20
User is offline View Users Profile Print this message


Eric Piallat

Posts: 4
Joined: 27-Nov-2007

In this case, I would rather use some Configuration File inside confSystem area than a specific module.

And define a persisent trigger on "Prefix" pre-change event, to check the file, then append it.

A good nice-to-have would be a loop like Louie's one to overwrite the list once a week with actual Prefix (to manage removals).
Report this to a Moderator Report this to a Moderator
 6-Dec-2007 22:11
User is offline View Users Profile Print this message


Mark Rietveld

Posts: 16
Joined: 6-Apr-2004

Originally posted by: Louie Landale

If you intend unique module Prefixes in the project then it seems you should have unique module names in the project as well; where the Prefix is simply the module name with an underscore suffix. This way, given an identifier reference, you can quickly and uniquely identify the module and the object. With this scheme, the Project admin decides the module names and the prefixes, not the person creating the module.

- Louie


I'm not sure if I need unique module names. Okay, would be better, but not necessary. When prefix is unique, one can always be sure to be in the correct module, although it may require some searching. Therefore we do have some simple prefix rules to make the search more easy:
[SPEC LEVEL]-[MODULE NAME ABREVIATION]:
To avoid module names becoming to long.

I'm not so handy with scripts. I'll try to adapt it to our needs whenever I can spend a day or so. Thanks for the example.

Kind regards,

Mark
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.