![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Open a module in exclusive edit Topic Summary: Trouble opening modules in exclusive edit and accessing their views Created On: 22-Jan-2009 22:32 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hey! I have script that opens a module that contains the path and name of other modules. The scripts goes to each of these modules and attempts to open the module, look at one of its view then determine if that view has a specific attribute. If the attribute is not there then it should add it then save and close the module before moving on to the next one. So far, the first problem I encountered was that the module would not open in exclusive edit. I opened the first module and it worked but complained that the next module needed to be opened in exclusive edit so I employed the use of DXL "edit" command. Now, it says that it can't find the view so I again opened the first module and it worked but complained that it could not find the view in the next module. I'm not sure if the module is being opened correctly or what. Any suggestions would be greatly appreciated!!!
Peace and Blessings, Nikki |
|
![]() |
|
![]() |
|
Difficult to know what is going wrong without seeing the code.
Open the modules read-only and only switch to exclusive edit if you need to create the attribute. You can save views in read-only mode. This will save time. Be careful of using functions that rely on the current Module being set. This can change when linked modules are opened in the background. Set the current Module explicitly. Modules need to be visible before you can load a view. ------------------------- Tony Goodman Smart DXL limited www.smartdxl.com |
|
![]() |
|
![]() |
|
You don't need to Edit a module to modify its views; Read works well.
Don't forget that after you load a view, insert a column, you must save that view. Many View commands (and also many Attribute and other commands) presume the 'current module'. The current module can and does change when you open other modules. I don't know the rules and suspect these rules have changed over the DOORS versions. When dealing with such commands that presume the current module, it behoves you to explicitely SET the current module before using them. My module scripts routinely save the current module: [Module g_mCurr = current()] at the top of then script, and when dealing with such commands it sets it: [current = g_mCurr; AttrDef ad = find("MyAttrName")]. In your case, you will want to set the module current after you load a view before you start monkeying with the views, since its likely the 'current' module changes as the view opens other modules. You can perhaps verify the changing of the current module by inserting these commands in strategic points in the module: [print "After Open, current = " (name(current Module)) "\n"] - Louie |
|
![]() |
|
![]() |
|
Thanks Tony! My boss is going to be pretty bummed when she finds out that it can't be done without the module being visible (which was my guess before I submitted to the forum). We are probably going to run into the exception issue that I outlined in another topic I submitted because this script is to be run on the same module that contains a loooong list of modules. Oh, well! What ya gonna do, huh?
Peace and Blessings, Nikki |
|
![]() |
|
![]() |
|
Louie - thanks for your comments as well.
|
|
![]() |
|
![]() |
|
Hey guys! I'm back again. I realized that the script now works now but still has a glaring problem. When using if (!exists (attribute "attribute")), the script is seeeing if the attrribute is in the module and not in the view. Is there a way to check if an attibute is included in a view? Thanks!
Peace and blessings, Nikki |
|
![]() |
|
![]() |
|
This example prints out the names of all the attributes displayed in the current view:
Module m = current Column c for c in m do { print "<" (attrName c) ">\n" } |
|
![]() |
|
![]() |
|
This little snippette distiquishes betweena column display the Main Column, one displaying an Attribute, and one displaying a Layout:
if (main(col)) Contains = "<Main>" elseif(!null attrName(col)) Contains = attrName(col) else Contains = "<Layout DXL>" |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Open a module in exclusive edit
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.