![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() 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: | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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.
|
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
use function isLocked to make your check
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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: |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Determine Module Status of Other Users?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.