Accessing module attributes without opening the module

I'm counting the number of unarchived formal modules by opening each module to test a module attribute (see code below), but this takes forever, especially since this count is only used to set up the progress bar, before I even start doing the real work. Is there a way to access a module attribute without opening the module?

Thanks,
Ken.
 

Item i
current = folder "/MyProject/MyFolder"
//Initialise progress bar
int nos = 0
int maxnos = 0
for i in current do
    {
        if (type(i) == "Formal") // Ignore sub-folders and link modules,
                {
                Module m = read(fullName(i), false) //Too slow!!!
                string IsArchived = m."Archived"
                if (IsArchived == "False")// Ignore archived modules
                        {
                        maxnos++ //Count number of modules to be reviewed
                        }
                }
        }
progressStart(dbExplorer, "My Report", "Initializing...", maxnos)

mcnairk - Thu Jul 19 13:16:05 EDT 2012

Re: Accessing module attributes without opening the module
Peter_Albert - Fri Jul 20 03:25:46 EDT 2012

Have a look at "Module Properties" in the DXL help:

Cheers,

Peter
 

ModuleProperties mp 
ModuleVersion mv 
string mname = "/My Project/Module1" 
string s 
mv  = moduleVersion(module mname) 
string err1 = getProperties (mv, mp) 
if (!null err1){ 
    print err1 "\n" 
} 
AttrType at 
print "Module Types: \n" 
for at in mp do { 
        print "\t - " (at.name) "\n" 
} 
print "\nModule Attributes: \n" 
for s in mp do { 
        print "\t - " s " : " 
        val = mp.s              "" 
        print val "\n" 
}

Re: Accessing module attributes without opening the module
mcnairk - Fri Jul 20 09:09:36 EDT 2012

Peter_Albert - Fri Jul 20 03:25:46 EDT 2012

Have a look at "Module Properties" in the DXL help:

Cheers,

Peter
 

ModuleProperties mp 
ModuleVersion mv 
string mname = "/My Project/Module1" 
string s 
mv  = moduleVersion(module mname) 
string err1 = getProperties (mv, mp) 
if (!null err1){ 
    print err1 "\n" 
} 
AttrType at 
print "Module Types: \n" 
for at in mp do { 
        print "\t - " (at.name) "\n" 
} 
print "\nModule Attributes: \n" 
for s in mp do { 
        print "\t - " s " : " 
        val = mp.s              "" 
        print val "\n" 
}

Thanks! This is exactly what I was looking for...

Ken.

Re: Accessing module attributes without opening the module
llandale - Fri Jul 20 10:22:35 EDT 2012

Peter_Albert - Fri Jul 20 03:25:46 EDT 2012

Have a look at "Module Properties" in the DXL help:

Cheers,

Peter
 

ModuleProperties mp 
ModuleVersion mv 
string mname = "/My Project/Module1" 
string s 
mv  = moduleVersion(module mname) 
string err1 = getProperties (mv, mp) 
if (!null err1){ 
    print err1 "\n" 
} 
AttrType at 
print "Module Types: \n" 
for at in mp do { 
        print "\t - " (at.name) "\n" 
} 
print "\nModule Attributes: \n" 
for s in mp do { 
        print "\t - " s " : " 
        val = mp.s              "" 
        print val "\n" 
}

You need a mechanism for bypassing module-level attr DXL, since if you try to retrieve it's value you will get numerous unpleasnt errors.

Re: Accessing module attributes without opening the module
Mathias Mamsch - Thu Aug 02 04:18:19 EDT 2012

llandale - Fri Jul 20 10:22:35 EDT 2012
You need a mechanism for bypassing module-level attr DXL, since if you try to retrieve it's value you will get numerous unpleasnt errors.

Is this new for some DOORS version? I remember that attribute DXL is not executed when using module properties (empty value) and we had a thread with Adamarla where I posted some bad hack to execute module attribute DXL 'manually' when using module properties. I think DXL will not be executed, but it was some time ago when I tried. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Accessing module attributes without opening the module
mcnairk - Thu Aug 02 08:11:16 EDT 2012

Mathias Mamsch - Thu Aug 02 04:18:19 EDT 2012
Is this new for some DOORS version? I remember that attribute DXL is not executed when using module properties (empty value) and we had a thread with Adamarla where I posted some bad hack to execute module attribute DXL 'manually' when using module properties. I think DXL will not be executed, but it was some time ago when I tried. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

We don't use module level DXL; I try to keep thinks as simple as possible...

THX,
Ken.

Re: Accessing module attributes without opening the module
llandale - Thu Aug 02 14:09:17 EDT 2012

Mathias Mamsch - Thu Aug 02 04:18:19 EDT 2012
Is this new for some DOORS version? I remember that attribute DXL is not executed when using module properties (empty value) and we had a thread with Adamarla where I posted some bad hack to execute module attribute DXL 'manually' when using module properties. I think DXL will not be executed, but it was some time ago when I tried. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Am using 9.3.0.6 and just now DOORS crashed completely using ModuleProperties to access a module-level Attr-DXL that uses "Current Module".

I see getting the Module Properties via right-click works fine, "Attr-DXL" is displayed for its value.

-Louie