Question

The "Manage Open Modules" dialog of DOORS 8.3 lists all open modules, their mode, if visible, etc. and the number of references. I want to use that reference count to decide if my script can securely close the module and to avoid closing if it is currently in use. I'm not sure what the "References" column displays exactly. I didn't find a description of it in the help or corresponding informations on the internet. Does anybody know if there is some undocumented DXL API which gives me access to that information?

Edit: I found the function refcount_ which returns an integer. But I have no idea what the return value means.

Was it helpful?

Solution 2

I assume your script is opening the modules, so all you need to do is check if it is already open first.

string sModuleFullName = "/Some/Module/Path"
Module oModule = module(sModuleFullName)
bool bClose = null(oModule)
if(null(oModule)) {
oModule = read(sModuleFullName, true,true)
}

// do stuff

if(bClose) {
close(oModule)
}

Edit: Alternative method for closing modules opened by triggers, attribute or layout dxl

// Save currently open Modules to a Skip
Skip oOpenModulesSkip = createString()
Module oModule
for oModule in database do {
    put(oOpenModulesSkip, fullName(oModule), fullName(oModule))
}

// do stuff

// Close Modules not in the Skip
for oModule in database do {
    if(!find(oOpenModulesSkip, fullName(oModule))) {
        close(oModule, false)
    }
}
delete(oOpenModulesSkip)

OTHER TIPS

It looks like References refers to the number of open modules currently referencing that module. For example: when you open a module that has links, DOORS also opens in the background all of the Link Modules that the links use. So if I open a document that has links through LINKMOD_A, LINKMOD_A will show 1 reference. If I then open another document that has links through that same LINKMOD_A the number of references will increase to 2. I do not see the number of references ever higher than 1 on a Formal Module. Try this on some of your modules and see when you get more than one reference on a link module, then run your refcount_ function against that link module and see if you get the same number. I am not sure if that is the function you are looking for but it is certainly possible. Good Luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top