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: Determine if a module is closed
Topic Summary:
Created On: 19-Dec-2008 04:17
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.
 19-Dec-2008 04:17
User is offline View Users Profile Print this message


Robert Smith

Posts: 9
Joined: 10-Mar-2008

Is there a way to determine if a module variable references a closed module?

e.g.

Module m = read("/my project/my module",false)

close m

// at this point isRead(m) still returns true but I can't use m with getMostRecentBaseline() and get baseline information.

as in:
Baseline bl = getMostRecentBaseline(m)
if ( bl != null )
{
string strTemp = (annotation bl)
string strNo_crs = utilReplaceChar(strTemp,'\n',' ')
strBaseline_info = (major bl) "." (minor bl) "." (suffix bl) ": " strNo_crs <-- line 28
}

gives
-R-E- DXL: <utilDoors_functions.dxl:28> operation requires a current module

Edited: 19-Dec-2008 at 04:19 by Robert Smith
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 06:54
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

The function "open" as in "bool open(ModName_ modRef)" seems to work correctly in this case. An example from DXL Help:

string s = "/proj1/SRD"
if (open module s) print "SRD is open\n"

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 07:54
User is offline View Users Profile Print this message


Robert Smith

Posts: 9
Joined: 10-Mar-2008

Thanks for the reply. I struggle with the DOORS DXL documentation. I don't see Modname_ in the index and don't know what it is. I find it astonishing that a Modname_ search turns up a lot of entries, but none of them give a definition - unless I have managed to miss it.

In my case I am being passed a Module variable and want to make sure it is pointing to an open module. Do you know how I would turn a Module variable into a Modname_ variable so I can use open()?

Edited: 19-Dec-2008 at 08:30 by Robert Smith
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 08:27
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

Yes, the best DXL documentation seems to be available in this forum. As long as you find the correct arguments for the Search :-)

Turning a Module handle to ModName_:

Module m = current
ModName_ mn = module(fullName(m))
print (open(mn))

or if you have already a module name in a string variable, then:

Module m = current
string ModName = fullName m
ModName_ mn = module ModName
print (open(mn))

The magic word here is the "module" which is in DXL Help:

module (handle)
Declaration
Module module(Item itemRef)
ModName_ module(string modRef)
Operation
The first form returns a handle of type Module for itemRef if itemRef is an open module. Otherwise, it returns null.

The second form returns a handle of type ModName_ for the named module, whether it is open or closed.

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 09:06
User is offline View Users Profile Print this message


Robert Smith

Posts: 9
Joined: 10-Mar-2008

Thanks Pekka! That worked beautifully!!


Re:
Module module(Item itemRef)

Item is like ModName_. Telelogic chose not to put it in their index.
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 14:05
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

module (handle)

Declaration

Module module(Item itemRef)
ModName_ module(string modRef)

Operation

The first form returns a handle of type Module for itemRef if itemRef is an open module. Otherwise, it returns null.

The second form returns a handle of type ModName_ for the named module, whether it is open or closed.


Yes there is no stand alone reference to the type ModName_ though.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 17:00
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Some time ago I demonstrated that closed/purged module and purged objects still allowed the corresponding Module or Object handle to be valid, but only for a short amount of time. That is, I could hardDelete(obj) and flushDeletions, but still get information from the (obj) for perhaps another 3 seconds.

Don't know if that helps, but it does illustrate a problem.

- Louie
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 21:05
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

So when closing modules good habit would be to set the module variable to be null after closing:

close m
m = null

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 19-Dec-2008 23:58
User is offline View Users Profile Print this message


Robert Smith

Posts: 9
Joined: 10-Mar-2008

>> Yes there is no stand alone reference to the type ModName_ though.

It really is astonishing that in an 8.x product manual you don't have entries for Modname_ and Item and others.

I once wrote a trouble ticket on their documentation style being incorrect.

They will write something like this:

current = Module module

when every other manual in the world would write it something like this

current = someModule

// someModule is a Module variable for an open module


or like this


Module m = read("/path/to/myModule",read)

current = m


and then they will insist that they do it the right way.

Edited: 20-Dec-2008 at 00:04 by Robert Smith
Report this to a Moderator Report this to a Moderator
 5-Jan-2009 23:09
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

There's probably some benefit to that, but in all the years I've been coding this stuff I've never come to a situation where my DXL might accidentally use a Module handle after the module is closed. That is, once I've closed the Module the variable is not used again, except where it goes back to the top of the loop and used to open the next module.

I suppose if you first stored open Module handles in a Skip list then you might accidenatally access a close module, but in that case not only must you set the handle false, you must also re-instert that null handle back in the Skip list (or of course, just delete it from the Skip).

It may get sticky if you hardDelete (purge) a module or object, then scan through the folder looking for Modules or scan through the module looking for Objects, where the purged thing is still visible for a few seconds.

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