![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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/ |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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/ |
|
![]() |
|
![]() |
|
Thanks Pekka! That worked beautifully!!
Re: Module module(Item itemRef) Item is like ModName_. Telelogic chose not to put it in their index. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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/ |
|
![]() |
|
![]() |
|
>> 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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Determine if a module is closed
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.