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 Trigger running upon close
Topic Summary:
Created On: 8-May-2006 22:24
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 Kevin Murphy, on Wednesday, May 10, 2006 3:27 PM

Answer:
I am using DOORS 7.1. I have a module. I have set a trigger in the module with the following code:

//code begin

Trigger t = trigger( "Update", module->"DOORS Update", post, open, 5, "#include <mypath/myfile.dxl>")

//code end

This is supposed to set the trigger to execute when the module is opened. This works. But the trigger is also executing upon the module being closed. In fact, the dxl script associated with the trigger calls the exit_() function to exit DOORS...

Okay, so I just ran a test. Apparently, when you create a trigger that does stuff and then automatically exits DOORS, it runs the trigger again if the exit_() function is called. Don't know if this is a bug or not. Figured I would document it here just in case it ever helps someone else save some time.

My solution was to create a module close event that would exit DOORS. No errors there.
 8-May-2006 22:24
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Answer Answer
I am using DOORS 7.1. I have a module. I have set a trigger in the module with the following code:

//code begin

Trigger t = trigger( "Update", module->"DOORS Update", post, open, 5, "#include <mypath/myfile.dxl>")

//code end

This is supposed to set the trigger to execute when the module is opened. This works. But the trigger is also executing upon the module being closed. In fact, the dxl script associated with the trigger calls the exit_() function to exit DOORS...

Okay, so I just ran a test. Apparently, when you create a trigger that does stuff and then automatically exits DOORS, it runs the trigger again if the exit_() function is called. Don't know if this is a bug or not. Figured I would document it here just in case it ever helps someone else save some time.

My solution was to create a module close event that would exit DOORS. No errors there.

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 8-May-2006 22:45
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Odd having a module trigger that exists DOORS. What, you detect such an error you cannot let the user continue?

I've worked with module open triggers before and surely would have noticed if the trigger was firing for modules still open when you exit DOORS via the GUI.

I know that a module is "opened" when you change its Open mode; perhaps its currently open ReadOnly and then you issue an Edit command; your trigger should fire again then. I don't think its "opened" when you downgrade its open status, from Edit to Read (via the "downgrade" perm). I think it IS "opened" again when you change from Shared to either Read or Exclusive. However, I cannot imagine why the exit_ perm would need to reopen the modules, right before it exits.

Not sure what will happen if you define your trigger from a spot other than the "DOORS Update" module. I don't think you need that hard coded since presumably you want it to run on the currently open module. I'd code your trigger to insure it doesn't do anything unless the current module is "DOORS Update".

Perhaps you have more than one trigger defined and don't know it. Your set-the-trigger code should always include some sort of delete-the-trigger code, perhaps structured like this:

if (confirm("Delete the trigger?")) delete("Update", module->"DOORS Update", post open 5)

if (confirm("Set the trigger?")) Trigger t = trigger( "Update", module->"DOORS Update", post, open, 5, "#include <mypath/myfile.dxl>")

Thus, this one piece of code also can delete an undesired trigger. Be sure to delete the trigger before you decide to change the name or features of the trigger, or the delete command won't find it.

- Louie
Report this to a Moderator Report this to a Moderator
 8-May-2006 23:53
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Louie,

Thank you so much for all the possibilities.

I can tell you that I only had one trigger (well, that B: Specific Close trigger kept appearing...)

What I am doing is an update for all of our DOORS users. I need to update everyone's registry and create some new DOORS icons on the users' desktop. Users are running DOORS locally, and not from a network share.

The solution I came up with involved creating a trigger that would call the update DXL when the module was opened. Once the update happens, I want DOORS to exit to ensure that the update worked correctly. If a user can't get back into DOORS, I know when the problem occured and that the user has not done anything in DOORS since.

The trigger does nothing in the module itself. It only runs code to do a registry update and call a VBS script. So changing the edit mode isn't a big deal.

And I was smart enough to give myself (but not other users) the choice to run the trigger. That way I don't always exit DOORS by opening the module, thus allowing me to edit the trigger and the module.

Once I took out the exit_() call from the DXL that the open trigger uses, the open trigger just ran one time.

Kevin

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 9-May-2006 15:36
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I ran the attached set-the-trigger code from an open module. When I reopen the module it correctly displays the infoBox and correctly prompts to "exit_". When it exists, the trigger does NOT fire up again. Tried it for v7.1 and 8.0.

(I sometimes get an exception violation after the Delete and during the Create. I think its because the delete command got to the server yet the reality of the delete hasn't gotten back to the client. If you delay a few seconds after deleting the trigger and before creating it, the exception violation doesn't occur).

When the Trigger "exit_()"s, the trigger does NOT fire again. This leads me to suspect either you have a second trigger running, or there's something inside the trigger not quite right, such as an "edit(NameMod)" command. Maybe it has something to do with you reloading DOORS while DOORS is still running. Perhaps the VBS script does some communication with your DOORS script, and VBS ends up re-opening the module while DOORS is exiting.

Perhaps your VBS script should issue the "exit_()" command instead of your trigger. I'm sure that's simple to do, but I've never actually done that, someone reading this will surely let us know what that looks like in VBS.

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


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

Louie,

Again, thank you for your thoroughness. I can tell you the VBS script does nothing with DOORS. It creates new icons on the users' desktops, and that's it. And I only have the one trigger running, and it's on the module. There are no other triggers in the database at all.

The fix for me was just removing the exit_() from the trigger's DXL and creating another trigger to that called exit_() upon module close (which the first trigger does).

I'd prefer to not share the DXL code here, but would be happy to send it to you personally if you'd like to try to figure this out.

-------------------------
Kevin Murphy
http://www.baselinesinc.com
The Requirements Management Experts
Report this to a Moderator Report this to a Moderator
 23-May-2006 18:38
User is offline View Users Profile Print this message


Thomas Hebendanz

Posts: 3
Joined: 13-Jun-2005

You can do an exit(dbExplorer) to exit. I also had problems with this looping problem. but giving exit the main window handle will shutdown DOORS and do not produce and loops. It seems DOORS exits clean this way but I cannot garantee
Report this to a Moderator Report this to a Moderator
 5-Jul-2006 18:56
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I just posted about the "exit_()" command rerunning the DXL that contains it. This seems to be situation that you described and has nothing to do with triggers.

- Louie
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.