Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Jan-2009 22:32
User is offline View Users Profile Print this message


Nikkia Carter

Posts: 18
Joined: 26-Feb-2008

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
Report this to a Moderator Report this to a Moderator
 23-Jan-2009 12:27
User is offline View Users Profile Print this message


Tony Goodman

Posts: 97
Joined: 6-May-2008

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
Report this to a Moderator Report this to a Moderator
 23-Jan-2009 20:03
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 23-Jan-2009 21:45
User is offline View Users Profile Print this message


Nikkia Carter

Posts: 18
Joined: 26-Feb-2008

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
Report this to a Moderator Report this to a Moderator
 27-Jan-2009 17:40
User is offline View Users Profile Print this message


Nikkia Carter

Posts: 18
Joined: 26-Feb-2008

Louie - thanks for your comments as well.
Report this to a Moderator Report this to a Moderator
 28-Jan-2009 21:10
User is offline View Users Profile Print this message


Nikkia Carter

Posts: 18
Joined: 26-Feb-2008

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
Report this to a Moderator Report this to a Moderator
 28-Jan-2009 23:58
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

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"
}
Report this to a Moderator Report this to a Moderator
 29-Jan-2009 03:14
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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>"
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.