![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Make invisible module visible Topic Summary: without reopening Created On: 4-Jun-2007 16:08 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Is there any command to open a module invisible and then make it visible? I ask because I need to get a handle on an open module, the only way I know of is to use read, share, or edit and the module name. But the problem is that when I open the module in share or edit(I'm opening it to edit so read is out), one of my triggers fires which I don't want. I'm trying to preserve someone having the module open already and not closing it.
So is there a way to do this? Alternately is there a way to get a handle on an already open module? ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hi David Here are some suggestions: 1. You can open a module visible or invisible as shown below for m in database do {
|
|
![]() |
|
![]() |
|
This is in fact quite a common thing to do, especially when you have troublesome views. See this post
Opening the module invisible will not prevent the trigger from firing, but I assume you have some sort of check in there so that it only does stuff if it is visible. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Thank you for the 2nd part Jaya.
Yes Tony. But the problem is that when I do the check if the module is already open, I had no way to get a handle to it. So doing share or edit again on the module will make the trigger refire because it was visible (the user was looking at it). Now that I know the loop above, I can loop through the open modules looking for the one I want and get a handle on it without reopening it. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Now, how do you make visible modules invisible (without closing and re-openning, and without changing the read/share/edit state)?
|
|
![]() |
|
![]() |
|
Not sure what's up, but here are some random related facts:
[] You can sort of get a module handle using ModName_ mn = module(NameFull). [] Yes, you can open invisibly using Module mod = read(NameFull, false). [] Yes, once its invisible you can open it again Visibly: mod = read(NameFull, true). [] If its already open invisibly and you open it visibly, its not actually 'opened' again and any open-triggers will NOT fire. [] If you upgrade the open-mode, say from Read to Edit, it IS 'opened' again. [] There exists 'downgrade' and 'downgradeshare' functionsto 'open' it at a lower level; read and shared respectively. These do not count as 'open' as far as triggers are conserned. [] There exists setReadOnly, setShareable, and setExclusive functions to quickly change the open mode. These work on the 'current' module so be SURE to issue: current = mod before using them. [] Going from Shared to Edit involves a downgrade and then an open Edit. [] I know of no way to make a visible module invisible without first closing it. [] Your open triggers probably want something like this at the top: if (!isVisible(current Module)) { deal with invisible open) } else { deal with visible open } - Louie |
|
![]() |
|
![]() |
|
One thing to add to your list Louie is that opening a baseline of a module does refire the triggers of that module. It quite annoying actually when you have 1 or more baselines being loaded to display data in layout dxl columns. Especially since, for me, this means a dialog pops up (from the trigger) when a view that contains those columns is loaded for the first time.
And having code to check the edit mode of the module doesn't work for the triggers (at least not for mine) because if you only want the triggers to fire for exclusive edit or shared, opening a baseline, which is read only, still fires the trigger. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Not sure what you meant in your 2nd paragraph, but my very first trigger (in v4) was a database wide post-module-open trigger that downgraded the open mode of a module for folks who lacked RMD rights to the module. That is, even if a user had only 'R' rights she could still open it Exclusive: she couldn't change anything but everyone else was locked out. Later versions of DOORS provided that capability in the GUI where Edit and Shared were greyed out if the user lacked rights, obsoleting the script.
So yes the Triggers fire but the first thing it can do is check the open mode of the module as follows: Module mCurr = current if (isRead(mCurr)) Process module opened Read elseif (isShare(mCurr)) Process module opened Shared else Process module opened Edit. where 'process' may very well be 'halt'. - Louie |
|
![]() |
|
![]() |
|
What I mean is my triggers only execute when the current module is opened in shared or edit. So I have a:
if(!isRead(m)) statement in the trigger code. But when I load a baseline, which you cannot edit and thus is read only, it still counts as the module reopening in the same mode as its currently open. So my post open triggers refire, see the current module as open in not read mode, and continue executing. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Did a little investigating, and yes when you open a baseline the triggers fire, but they fire for the current version of the module and not the baseline. Inside the trigger use 'currrent module' and 'isBaseline' but could not get the trigger to be able to tell that its the baseline open that's firing the trigger. There may be some potential using "ModuleVersion (current Trigger)" but I've not actually dealt with ModuleVersion before and am not sure how to proceed.
Attached is the trigger code I tried to use. Run it on a module that has a baseline. - Louie |
|
![]() |
|
![]() |
|
Hi David, Hi Louie,
I was fallen into the same "Trap-Doors" a while ago too ![]() There is a simple trick to get real firering Module(version) instead of current version. Module module(Trigger t, int unused) described in DXL reference manual (really ![]() <cite> The third form is as Module module(Trigger), but this variant will return baselined modules when a module-level trigger is running against a baseline of a module. For non-module triggers, the returned Module is the same as Module module(Trigger). The unused integer parameter should be 0. </cite> I remember, that I was really supprised about the stupid "unused" parameter, but it works. Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Taking Louie's idea, I found that doing:
Trigger openTrigger = current Module triggerModule = module(openTrigger) if(!null(triggerModule)) { halt } Works good too. The module returned by "module(openTrigger)" is always null when the module is first opened. But when baselines are opened following that, the module returned by that call is not null and thus, I can have the triggers not fire. However. I think I'm going to use your solution Reik as its more foolproof. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Make invisible module visible
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.