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: Determine Module Status of Other Users?
Topic Summary: Check if other users have Exclusive Edit on a Module?
Created On: 12-May-2006 03:33
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.
Answer This question was answered by David Cripps, on Friday, May 12, 2006 4:10 PM

Answer:
Thank you Robert, Ron, and Tony for taking the time to respond to my inquiry. 

Ron was right on the money with the isLocked() function (of course it was right in front of me in the manual the whole time...).  As an added bonus, though, I was also able to discern the code to get extra information about the locked Module.  Even though Tony points out that only database managers can access the Lock List, I do not believe that is true since I am not a database manager and I was able to successfully access the Lock List.  I think only database managers are the only ones able to actually remove a Module lock put in place by other users.

For anyone interested here is the code that will simply print out the info:
 12-May-2006 03:33
User is offline View Users Profile Print this message


David Cripps

Posts: 6
Joined: 25-Jan-2006

I'm relatively new to DXL, so I apologize if this is an easy thing to do and I'm just overlooking it... I have a script that creates links between various Objects within various Modules using info read in from an external Excel file.  When I open the "source" Modules to create the links I open them as Shared Edit, but if another user has one of the "source" Modules open as Exclusive Edit, I get a prompt notifying me that the module is already opened exclusive by another user (the same prompt you get if you simply double-click on the Module to open it and someone else already has it open). 

Of course if I cancel opening the Module my script will halt and conversely if I tell it to open as Read Only the script fails when it tries to create a link.  Is there any way within DXL to determine if someone else already has a Module open as Exclusive, that way I can notify the script user and gracefully halt my script.  Thanks!

          -dc
Report this to a Moderator Report this to a Moderator
 12-May-2006 08:25
User is offline View Users Profile Print this message


Robert Swan

Posts: 86
Joined: 14-Apr-2005

I haven't tried this but I suggest useing the 'open' function to see if the module is open, then canWrite to see if you have access will help. This assumes that you haven't opened them read only yourself. The functions are described in the DXL manual under Modules>ModuleInformation>Module State.
Report this to a Moderator Report this to a Moderator
 12-May-2006 12:52
User is offline View Users Profile Print this message


David Cripps

Posts: 6
Joined: 25-Jan-2006

Robert

Unfortunately that was the approach I started with.  What appears to happen is that the open() function only checks to see if I have the Module open, not anyone else.  That wasn't too bad, because I then tried calling canWrite() to see if could get write access, but I started to get strange results -- for example, I specifically opened a Module as Exclusive Edit, then called canWrite() on the Module and I got a 'false' result!  Also, I believe the canWrite() function can only be called on an opened module -- that gives me a chicken-and-egg situation. 
Report this to a Moderator Report this to a Moderator
 12-May-2006 13:23
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

use function isLocked to make your check
Report this to a Moderator Report this to a Moderator
 12-May-2006 14:16
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

isLocked will tell you that the module is locked by someone. That someone may be you, so you also need to check whether you have it open.

Unforunately I do not know of a way of finding out what type of lock another user has, i.e. shared or exclusive, or who the other user is, without using the Lock List and only database managers can access the lock list.

The following will tell you whether someone has it locked.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 12-May-2006 16:10
User is offline View Users Profile Print this message


David Cripps

Posts: 6
Joined: 25-Jan-2006

Answer Answer
Thank you Robert, Ron, and Tony for taking the time to respond to my inquiry. 

Ron was right on the money with the isLocked() function (of course it was right in front of me in the manual the whole time...).  As an added bonus, though, I was also able to discern the code to get extra information about the locked Module.  Even though Tony points out that only database managers can access the Lock List, I do not believe that is true since I am not a database manager and I was able to successfully access the Lock List.  I think only database managers are the only ones able to actually remove a Module lock put in place by other users.

For anyone interested here is the code that will simply print out the info:
Report this to a Moderator Report this to a Moderator
 12-May-2006 19:16
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Use the following as a template for scripts that open modules to change them. This covers the case that its locked and the user was prompted with the "ReadOnly" or "Cancel" dialog.

string NameMod = "MyMod"

Module mod = edit(MyMod, false)
if (null mod) error, return
if (!isEdit mod) error, close(mod, return

- Louie
Report this to a Moderator Report this to a Moderator
 15-May-2006 09:33
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

David,
You are correct, thanks for that.
The manual is incorrect. I tested this and the user only needs read access to view the locklist in a module.

I think you have to be a database manager to view locks in database...

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.