Hi all. I'm having an issue that I'd like some help with. I am not a Software Engineer, so I'm sur ethat this is a simple issue for most of you, but the solution is escaping me. for item in current Project do { iType = type(item) if (iType == "Formal") { } }
MHerald - Thu Aug 27 07:48:08 EDT 2009 |
Re: Getting a Handle on a Module
Open the module, either read-only, shareable or for edit. In the example below I open the module as read-only by getting the fullName of the item and then print out the module name and description. Item item = (Item null) string iType = "" Module m = null for item in current Project do { iType = type(item) if (iType == "Formal") { m = read(fullName(item), false) print name(m) ": " m."Description" "\n" close m } } }
|
Re: Getting a Handle on a Module Thanks again. |
Re: Getting a Handle on a Module SystemAdmin - Thu Aug 27 08:06:00 EDT 2009
Open the module, either read-only, shareable or for edit. In the example below I open the module as read-only by getting the fullName of the item and then print out the module name and description. Item item = (Item null) string iType = "" Module m = null for item in current Project do { iType = type(item) if (iType == "Formal") { m = read(fullName(item), false) print name(m) ": " m."Description" "\n" close m } } }
I am looking for a dxl script where it will generate a report for all the modules the attribute "last modified by" and "last modified on" data with the module path. Kindly do the needfull. kindly let me know if this possible. Thank you! Regards, Shruthi |
Re: Getting a Handle on a Module MHerald - Thu Aug 27 08:49:22 EDT 2009
You do not need to open the module if you only want to query module attributes. There is a fuction for querying the module properties of a module: string readProperty(ModuleVersion mv, string sName) { // Unfortunately, the DXL-perm getProperties() has a momory leak in DOORS 8.2 (is fixed in DOORS 8.3), when a closed module is opened. // In DOORS 8.2 it is therefore better to open the module and read the module attribute directly. string errString = getProperties (mv, modProp) string attrName if (null errString) { for attrName in modProp do { if (attrName == sName) return (modProp.sName) "" } } return "" } ModName_ mn = module "/Playground/MyModule" // lets read from the current version print readProperty(moduleVersion mn, "Created On") "\n" print readProperty(moduleVersion mn, "Last Modified On") "\n" print readProperty(moduleVersion mn, "Name") "\n"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Getting a Handle on a Module SystemAdmin - Thu Aug 27 08:06:00 EDT 2009
Open the module, either read-only, shareable or for edit. In the example below I open the module as read-only by getting the fullName of the item and then print out the module name and description. Item item = (Item null) string iType = "" Module m = null for item in current Project do { iType = type(item) if (iType == "Formal") { m = read(fullName(item), false) print name(m) ": " m."Description" "\n" close m } } }
I am looking for a dxl script where it will generate a report for all the modules the attribute "last modified by" and "last modified on" data based on only the project selected in the GUI with the module path. Kindly do the needfull. kindly let me know if this possible. Thank you! Regards, Shruthi |
Re: Getting a Handle on a Module SystemAdmin - Thu Aug 27 08:06:00 EDT 2009
Open the module, either read-only, shareable or for edit. In the example below I open the module as read-only by getting the fullName of the item and then print out the module name and description. Item item = (Item null) string iType = "" Module m = null for item in current Project do { iType = type(item) if (iType == "Formal") { m = read(fullName(item), false) print name(m) ": " m."Description" "\n" close m } } }
{code} if (open(module(fullName(item)))) { |
Re: Getting a Handle on a Module David_G_Bond - Thu Jun 23 10:06:09 EDT 2011 Okay, the darn interface zigged when I wanted it to zag and it didn't let me edit it. What I was saying is that I always check to see if a module is already open before I open it. I've had memory problems in some cases where a lot of links are followed if I blindly open the modules. I suggest something like the following: Item it = (Item null) string iType = "" Module m = null string sItemName for it in current Project do { iType = type(it) if (iType == "Formal") { sItemName = fullName(it) if (open(module(sItemName))) m = module(it) else m = read(sItemName, false) print name(m) ": " m."Description" "\n" close m } } |
Re: Getting a Handle on a Module Mathias Mamsch - Thu Jun 23 07:38:54 EDT 2011
You do not need to open the module if you only want to query module attributes. There is a fuction for querying the module properties of a module: string readProperty(ModuleVersion mv, string sName) { // Unfortunately, the DXL-perm getProperties() has a momory leak in DOORS 8.2 (is fixed in DOORS 8.3), when a closed module is opened. // In DOORS 8.2 it is therefore better to open the module and read the module attribute directly. string errString = getProperties (mv, modProp) string attrName if (null errString) { for attrName in modProp do { if (attrName == sName) return (modProp.sName) "" } } return "" } ModName_ mn = module "/Playground/MyModule" // lets read from the current version print readProperty(moduleVersion mn, "Created On") "\n" print readProperty(moduleVersion mn, "Last Modified On") "\n" print readProperty(moduleVersion mn, "Name") "\n"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Whoops, that code was incomplete, Mathias // declare ModuleProperties (darn who activated my auto declare ...) ModuleProperties modProp
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Getting a Handle on a Module Mathias Mamsch - Thu Jun 23 07:38:54 EDT 2011
You do not need to open the module if you only want to query module attributes. There is a fuction for querying the module properties of a module: string readProperty(ModuleVersion mv, string sName) { // Unfortunately, the DXL-perm getProperties() has a momory leak in DOORS 8.2 (is fixed in DOORS 8.3), when a closed module is opened. // In DOORS 8.2 it is therefore better to open the module and read the module attribute directly. string errString = getProperties (mv, modProp) string attrName if (null errString) { for attrName in modProp do { if (attrName == sName) return (modProp.sName) "" } } return "" } ModName_ mn = module "/Playground/MyModule" // lets read from the current version print readProperty(moduleVersion mn, "Created On") "\n" print readProperty(moduleVersion mn, "Last Modified On") "\n" print readProperty(moduleVersion mn, "Name") "\n"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I have huge list of modules in a database like almost around 2000 modules, so i want to run a script were it will display the module names and module attributes "Last modified by" and "Last modified on" for the current project. In the current project there are huge list of sub projects so it has to run through all the items inside that and print only the module name and module attributes as mentioned above. i have tried the below script but since the database is containing a huge data so the doors is crashing. Kindly help me out is there any better way were i am able to run the script at a stretch to display the module names and the module attributes. //Stream str_Groups = write("C:/temp/doorsGroupList.tsv") //str_Groups << "ModuleName" << "\t" << "LastModifiedBy" "\t" << "LastModifedOn" << "\n" pragma runLim,0 Item it = (Item null) string iType = "" Module m = null string sItemName print "ModuleName" "\t" "LastModifiedBy" "\t" "LastModifedOn" "\n" int count = 0; for it in current Project do { iType = type(it) if (iType == "Formal") { m = read(fullName(it), false) if(!null m) { print fullName(m) "\t" m."Last Modified By" "\t" m."Last Modified On" "\n" //str_Groups << fullName(m) << "\t" << m."Last Modified By" << "\t" << m."Last Modified On" "\n" close m } } } |
Re: Getting a Handle on a Module Bosch - Thu Aug 18 10:10:25 EDT 2011
Go with Mathias' method of querying ModuleProperties which do not require you to open the module. void DealWithModule(string NameModFull) { // do whatever I want } void DealWithFolder(Folder fld) { // RECURSIVE ENABLED. Process folder and sub-folders and sub-projects if (null fld) return() Skip skpItems = create() Item itm Folder fldNew for itm in fld do { put(skpItems, name(itm), itm) // sorts in Alpha order } for itm in skpItems do { if (type(itm) != "Formal") continue DealWithModule(fullName(itm)) } for itm in skpItems do { if (type(itm) != "Folder" and type(itm) != "Project") continue fldNew = folder(itm) DealWithFolder(fldNew) // ** RECURSION ** } delete(skpItems) } DealWithFolder(current Folder)
|