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: Automatic linkset pairing on several modules of the same project
Topic Summary: Linkset creation
Created On: 9-May-2006 14:57
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.
 9-May-2006 14:57
User is offline View Users Profile Print this message


Jacqueline Fabre

Posts: 1
Joined: 9-May-2006



question.txt
question.txt  (0 KB)

Report this to a Moderator Report this to a Moderator
 9-May-2006 15:51
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Be advised that while the GUI lets you access LinkSetPairings (known as "Default Link Modules" DLM in DXL) from the module's properties sheet, these LMDs are actually stored in the folder housing the source module. Thus DXL works on the folder, not the module.

The attached code should get you started.

Also be advised that if you move the module or rename it, I believe the LMDs associated with it are lost.

Also be advised that "overrideable" is NOT the same as "not mandatory"; although it should be. "Overrideable" is implemented attrociously and means you can put links in the Default Link Module typically "DOORS Links"; and in fact there's no real way to prevent links from going there. Not Overrideable and not Mandatory means you can explicitely put the links in some other link module of your choosing, using the createLinks tool. Thus, LMDs should either be Mandatory or not, they should NEVER be overrideable.

- Louie
Report this to a Moderator Report this to a Moderator
 3-Aug-2006 00:58
User is offline View Users Profile Print this message


AMITAVA DAS

Posts: 2
Joined: 13-Apr-2006

 I am looking for a DXL which will automatically create the linkset between all the modules of a folder to all the modules of another folder within the same project. Do you have a similar kind of example?
Report this to a Moderator Report this to a Moderator
 3-Aug-2006 17:43
User is offline View Users Profile Print this message


Eric Piallat

Posts: 33
Joined: 26-Jan-2004

I am currently working on the following code.

It allows to select a set of source modules and a set of target modules, then create linkset pairing for each couple of them.
Filters are regexps. More than one directory may be searched.

This DXL assumes that there is one link module per source module, and that its name is the same as the source module, suffixed by "_satisfies".

It may be messy as I am still working on it, and it may not meet your needs, but it contains imho an exemple of every needed function to create linksets and linkset pairings.

-------------------------
E. Piallat
CeBeNetwork
Report this to a Moderator Report this to a Moderator
 2-May-2007 21:18
User is offline View Users Profile Print this message


Craig Forant

Posts: 56
Joined: 21-Feb-2005

Eric,

This is nice...let us know when you get it completed. it seems like it will be a nice tool to have around.

Thanks for sharing.

-------------------------
Craig Forant
me@craigforant.com
Report this to a Moderator Report this to a Moderator
 3-Feb-2008 09:50
User is offline View Users Profile Print this message


Jon Martin

Posts: 49
Joined: 22-Nov-2006

Eric

Do you have a newer Ver. of this?

Jon.
Report this to a Moderator Report this to a Moderator
 12-Aug-2008 11:34
User is offline View Users Profile Print this message


Gerhard Schneider

Posts: 2
Joined: 17-Jul-2008

I enhanced the script to support the explicit selection of one link module that shall be used to connect sources and targets (the previous version calculated the link module name, however, this was not appropriate for our situation).
Report this to a Moderator Report this to a Moderator
 12-Aug-2008 12:26
User is offline View Users Profile Print this message


Gerhard Schneider

Posts: 2
Joined: 17-Jul-2008

Hm, how to attach a file here? Anyway, here is the code:

--- snip ---

// Create mandatory linkset from or to a set of module

/*
* Launch a dialog box allowing
* * To select source modules from a list generated from
* * all modules within a folder selected from a database browser
* * matching a particular regexp
* * To select source modules from a list generated from
* * all modules within a folder selected from a database browser
* * matching a particular regexp
* * (Still to be done: for now type is "satisfies") To choose linking type (= link module suffix)
*
* * To launch linkset creation, that is :
* * For each source module, and for each target module:
* * create a linkset inside the link module corresponding to:
* - source module
* - linking type
* * declare this linkset mandatory for pairing
* * declare exclusive linksets list of source module
*
* * Enhancement: select one link module that shall be used to connect sources and targes
*
* TODO Select suffix
*
* author E. Piallat (Silicom)
* date 2006-06-13
*
* enhanced by Gerhard Schneider, HOOD GmbH
* date 2008-08-12
*
*/
DB db
DBE dbeSourceFrame
DBE dbeSBrowse, dbeSFolder
DBE dbeSRegexp, dbeSRefresh
DBE dbeSModules

DBE dbeTargetFrame
DBE dbeTBrowse, dbeTFolder
DBE dbeTRegexp, dbeTRefresh
DBE dbeTModules

DBE dbeLinkFrame
DBE dbeLBrowse, dbeLFolder
DBE dbeLRegexp, dbeLRefresh
DBE dbeLModules

DBE dbeLSuffix
DBE dbeLog

string createMandatoryLinksetLinkMod (string nSourceMod, //-
string nTargetMod, //-
string nLinkMod)
{
string sErreur
LinkModuleDescriptor lmd

Module linkMod = edit (nLinkMod,false)
if (null linkMod) return "missing link module"
Linkset ls = create (linkMod, nSourceMod, nTargetMod)

Folder fSource = getParentFolder module nSourceMod
setLinkModuleDescriptorsExclusive (fSource, module nSourceMod, true)
sErreur = addLinkModuleDescriptor (fSource, nSourceMod, nTargetMod, //-
false, fullName of linkMod, "")
for lmd in fSource do
if ( (name module ((getSourceName lmd)"") == name module nSourceMod ) && //-
(name module ((getTargetName lmd)"") == name module nTargetMod ) )
setMandatory(lmd,true)
save linkMod
close linkMod

return sErreur
}


string createMandatoryLinksetInSuffixed (string nSourceMod, //-
string nTargetMod, //-
string suffix)
{
string sErreur
LinkModuleDescriptor lmd

Module linkMod = edit (nSourceMod suffix,false)
if (null linkMod) return "missing link module"
Linkset ls = create (linkMod, nSourceMod, nTargetMod)

Folder fSource = getParentFolder module nSourceMod
setLinkModuleDescriptorsExclusive (fSource, module nSourceMod, true)
sErreur = addLinkModuleDescriptor (fSource, nSourceMod, nTargetMod, //-
false, fullName of linkMod, "")
for lmd in fSource do
if ( (name module ((getSourceName lmd)"") == name module nSourceMod ) && //-
(name module ((getTargetName lmd)"") == name module nTargetMod ) )
setMandatory(lmd,true)
save linkMod
close linkMod

return sErreur
}

string createMandatoryLinksetInSuffixed (string nSourceMod, //-
string nTargetMod)
{
return createMandatoryLinksetInSuffixed (nSourceMod,nTargetMod,"_satisfies")
}


void createLinksets (DB db) {
string nTarget ,nSource, nLink, report
Buffer log = create

for nSource in dbeSModules do
{
for nTarget in dbeTModules do
{
for nLink in dbeLModules do
{
/*--- Original ---
report = nSource " ==> " nTarget "\t" //-
createMandatoryLinksetInSuffixed (nSource,nTarget) "\n"
*/
report = nSource " ==> " nTarget "\t" //-
createMandatoryLinksetLinkMod (nSource,nTarget,nLink) "\n"

print report
log = log report
set (dbeLog,tempStringOf log)
}
}
}
}

void refreshSource (DBE dbe)
{
string fName = get dbeSFolder
string sourceFilter = get dbeSRegexp
Regexp isIn = regexp sourceFilter
if (null item fName ) return
if (!(folder fName)) return
Item i
int noOfValues = 0
string opts[] = {"Keep", "Empty"}
int resp = query (db,"Keep previous value or empty list?",opts)
if (resp == 1) empty dbeSModules
for i in folder fName do
if ((type of i) "" == "Formal")
if (isIn name of i)
insert (dbeSModules,noOfValues++,fullName of i)
}

void doBrowseSource(DBE dbe)
{
string fName = fnMiniExplorer(db, current Folder, 0, //-
"Browse", "Select folder to be searched as SOURCE")
set(dbeSFolder, fName)
refreshSource(dbe)
}

void refreshTarget (DBE dbe)
{
string fName = get dbeTFolder
string sourceFilter = get dbeTRegexp
Regexp isIn = regexp sourceFilter
if (null item fName ) return
if (!(folder fName)) return
Item i
int noOfValues = 0
string opts[] = {"Keep", "Empty"}
int resp = query (db,"Keep previous value or empty list?",opts)
if (resp == 1) empty dbeTModules
for i in folder fName do
if ((type of i) "" == "Formal")
if (isIn name of i)
insert (dbeTModules,noOfValues++,fullName of i)
}

void doBrowseTarget(DBE dbe)
{
string fName = fnMiniExplorer(db, current Folder, 0, //-
"Browse", "Select folder to be searched as TARGET")
set(dbeTFolder, fName)
refreshTarget(dbe)
}

void refreshLink (DBE dbe)
{

string fName = get dbeLFolder
string linkFilter = get dbeLRegexp
Regexp isIn = regexp linkFilter
if (null item fName ) return
if (!(folder fName)) return
Item i
int noOfValues = 0
string opts[] = {"Keep", "Empty"}
int resp = query (db,"Keep previous value or empty list?",opts)
if (resp == 1) empty dbeLModules
for i in folder fName do
if ((type of i) "" == "Link")
if (isIn name of i)
insert (dbeLModules,noOfValues++,fullName of i)

}

void doBrowseLink(DBE dbe)
{

string fName = fnMiniExplorer(db, current Folder, 0, //-
"Browse", "Select folder to be searched as LINK")
set(dbeLFolder, fName)
refreshLink(dbe)
}



db = create("Create multiple Linksets")

/*--- Source Frame ---*/
dbeSourceFrame = frame (db,"Source",150,100)
dbeSourceFrame -> "right" -> "unattached"
dbeSourceFrame -> "bottom" -> "unattached"

dbeSFolder = field(db, "source folder", "", 50, false)
set(dbeSFolder,refreshSource)
dbeSFolder->"left"->"inside"->dbeSourceFrame
dbeSFolder->"top"->"inside"->dbeSourceFrame

dbeSBrowse = button(db, "Browse...", doBrowseSource)
dbeSBrowse ->"left" -> "flush" -> dbeSFolder
dbeSBrowse ->"right"->"inside"->dbeSourceFrame
dbeSBrowse ->"top"->"inside"->dbeSourceFrame

dbeSRegexp = field(db, "source filter", "", 50, false)
set(dbeSRegexp,refreshSource)
dbeSRegexp ->"top" -> "flush" -> dbeSFolder
dbeSRegexp ->"left"->"inside"->dbeSourceFrame

dbeSRefresh = button(db, "Reapply", refreshSource)
dbeSRefresh ->"left" -> "flush" ->dbeSRegexp
dbeSRefresh ->"right"->"inside"->dbeSourceFrame
dbeSRefresh ->"top"->"aligned"->dbeSRegexp

string values[]
dbeSModules = multiList(db, "Source Modules", 50, 20, values,0)
dbeSModules ->"top" -> "flush" -> dbeSRegexp
dbeSModules ->"left"->"inside"->dbeSourceFrame
dbeSModules ->"right"->"inside"->dbeSourceFrame
dbeSModules ->"bottom"->"inside"->dbeSourceFrame

/*--- Target Frame ---*/
dbeTargetFrame = frame (db,"Target",100,100)
dbeTargetFrame ->"left" -> "flush" -> dbeSourceFrame
dbeTargetFrame ->"top" -> "aligned" -> dbeSourceFrame
dbeTargetFrame ->"right" -> "spaced"
dbeTargetFrame -> "bottom" -> "flush"

dbeTFolder = field(db, "Target folder", "", 50, false)
set(dbeSFolder,refreshTarget)
dbeTFolder ->"left"->"inside"->dbeTargetFrame
dbeTFolder ->"top"->"inside"->dbeTargetFrame

dbeTBrowse = button(db, "Browse...", doBrowseTarget)
dbeTBrowse ->"left" -> "flush" -> dbeTFolder
dbeTBrowse ->"right"->"inside"->dbeTargetFrame
dbeTBrowse ->"top"->"inside"->dbeTargetFrame

dbeTRegexp = field(db, "Target filter", "", 50, false)
set(dbeTRegexp,refreshTarget)
dbeTRegexp ->"top" -> "flush" -> dbeTFolder
dbeTRegexp ->"left"->"inside"->dbeTargetFrame

dbeTRefresh = button(db, "Reapply", refreshTarget)
dbeTRefresh ->"left" -> "flush" ->dbeTRegexp
dbeTRefresh ->"right"->"inside"->dbeTargetFrame
dbeTRefresh ->"top"->"aligned"->dbeTRegexp

dbeTModules = multiList(db, "Target Modules", 50, 20, values,0)
dbeTModules ->"top" -> "flush" -> dbeTRegexp
dbeTModules ->"left"->"inside"->dbeTargetFrame
dbeTModules ->"right"->"inside"->dbeTargetFrame
dbeTModules ->"bottom"->"inside"->dbeTargetFrame

/*--- Link Frame ---*/

dbeLinkFrame = frame (db, "Link Module", 100, 100)
dbeLinkFrame -> "left" -> "aligned" -> dbeSourceFrame
dbeLinkFrame -> "top" -> "flush" -> dbeSourceFrame
dbeLinkFrame -> "right" -> "spaced"
dbeLinkFrame -> "bottom" -> "flush"

dbeLFolder = field(db, "Link Module Folder", "", 50, false)
set(dbeLFolder, refreshLink)
dbeLFolder -> "left" -> "inside" -> dbeLinkFrame
dbeLFolder -> "top" -> "inside" -> dbeLinkFrame

dbeLBrowse = button(db, "Browse...", doBrowseLink)
dbeLBrowse -> "left" -> "flush" -> dbeLFolder
dbeLBrowse -> "right" -> "inside" -> dbeLinkFrame
dbeLBrowse -> "top" -> "inside" -> dbeLinkFrame

dbeLRegexp = field(db, "Link Module filter", "", 50, false)
set(dbeLRegexp, refreshLink)
dbeLRegexp -> "top" -> "flush" -> dbeLFolder
dbeLRegexp -> "left" -> "inside" -> dbeLinkFrame

dbeLRefresh = button(db, "Reapply", refreshLink)
dbeLRefresh -> "left" -> "flush" -> dbeLRegexp
dbeLRefresh -> "right" -> "inside" -> dbeLinkFrame
dbeLRefresh -> "top" -> "aligned" -> dbeLRegexp

string valuesL[]
dbeLModules = list(db, "Link Modules", 10, 5, valuesL, 0)
dbeLModules -> "top" -> "flush" -> dbeLRegexp
dbeLModules -> "left" -> "inside" -> dbeLinkFrame
dbeLModules -> "right" -> "inside" -> dbeLinkFrame
dbeLModules -> "bottom" -> "inside" -> dbeLinkFrame

/*
DBE dbeSplit = splitter (db,dbeSourceFrame,dbeTargetFrame,5)
dbeSplit -> "bottom" -> "aligned"->dbeSourceFrame
*/

dbeLog = text(db, "Created linksets", "", 20,200, false)
dbeLog ->"top" -> "flush" -> dbeLinkFrame

apply(db, createLinksets)

realize db
show db

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