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: Make invisible module visible
Topic Summary: without reopening
Created On: 4-Jun-2007 16:08
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.
 4-Jun-2007 16:08
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 5-Jun-2007 07:43
User is offline View Users Profile Print this message


Jayaprakash Lingamaneni

Posts: 20
Joined: 23-Jun-2006

Hi David

Here are some suggestions:

1. You can open a module visible or invisible as shown below
         Module edit(string name[,bool disp])
         Visible - If disp is true
         Invisible - If disp is false

2. We can find all opened modules as shown below

         
         Module m

         for m in database do {
               if(isVisible(m)) {
                        print "Visible Modules : " fullName(m)"\n"
               }
               else {
                        print "Invisible Modules : " fullName(m)"\n"
               }
         }


 

Report this to a Moderator Report this to a Moderator
 5-Jun-2007 09:06
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 5-Jun-2007 17:35
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 31-Jul-2007 20:55
User is offline View Users Profile Print this message


David Jakad

Posts: 94
Joined: 20-Jul-2007

Now, how do you make visible modules invisible (without closing and re-openning, and without changing the read/share/edit state)?
Report this to a Moderator Report this to a Moderator
 1-Aug-2007 01:28
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 1-Aug-2007 19:09
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 1-Aug-2007 23:01
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 2-Aug-2007 19:01
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 3-Aug-2007 20:17
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 07:12
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 6-Aug-2007 15:47
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.