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: about trigger
Topic Summary:
Created On: 20-Dec-2002 16:09
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.
 20-Dec-2002 16:09
User is offline View Users Profile Print this message


Hong Zhang

Posts: 29
Joined: 12-Sep-2002

Hi everybody,

I want to set a module based trigger. From the DOORS DXL MANUAL, I know I should store this trigger with this module. But I don't understand how to do it. Can anybody tell me where exactly the physical location the following code should be stored?

Trigger t2 = trigger("mod", module->all,
pre, close, 10,
"#include <triggers/modClose>")

thanks a lot,
hong
Report this to a Moderator Report this to a Moderator
 20-Dec-2002 17:39
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The "Level" of the trigger determines the stored location. Since your level is "all modules" but not "all projects", it should store the trigger in the current PROJECT. To store it in the current module, you will need to say "module -> current" or "module -> NameModule"; but then it will only apply to this module.

I had to write a separate script just to find and remove triggers left all over the place. Odd there is no mechanism for doing that normally.
Report this to a Moderator Report this to a Moderator
 26-Dec-2002 15:59
User is offline View Users Profile Print this message


Hong Zhang

Posts: 29
Joined: 12-Sep-2002

Louie,

Thanks a lot for your help. Bear with me, I am still not very clear where this piece of code to be stored? Should I save this piece of code as trigger.dxl, then find this particular module folder (e.g., m0000000x.mod) and put the trigger.dxl in it?

thanks again,
hong
Report this to a Moderator Report this to a Moderator
 2-Jan-2003 22:41
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Do NOT find and modify the internal database file system. If you are new to DXL, you may want to avoid triggers.

You will obviously want to keep the code somewhere yourself.

"LayOut" dxl is stored in the relevant module "view"; likewise active trigger code is stored as per the defined level. To activate the trigger code, you need to write MORE dxl code to define the trigger (such as you have done). When you run your example what gets "stored" in the project is the "#include" statement, which points to the body of the trigger that you have stored in "triggers/modClose", wherever that is <<no doubt some file location relative to your "addins" path>>. This is a good construct since it lets you modify the body and the trigger automatically gets updated. The bad news is that everybody will need to have access to the exact same locations before your trigger will apply to everyone.

Unlike layout, you really don't care where the trigger is "stored".

The current problem with triggers is that there is no mechanism for removing them or even displaying them: you have to write special code for each trigger (or write some code that searches for triggers and offers to delete them).

- Louie
Report this to a Moderator Report this to a Moderator
 10-May-2004 17:06
User is offline View Users Profile Print this message


Catherine Yan

Posts: 43
Joined: 4-Aug-2003

Hi, Louie,
Do you mind sharing how to find all triggers present in a project or module?

Thanks!
Catherine
Report this to a Moderator Report this to a Moderator
 10-May-2004 19:30
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

void PrintTrigger(Trigger trg)
{
string Name = trg.name
print Name "\n"
if (confirm("Delete trigger '" Name "'??))
delete(trg)
}

Trigger trg
for trg in database do
PrintTrigger(trg)

for trg in current Project do
PrintTrigger(trg)

for trg in current Module do
PrintTrigger(trg)
Report this to a Moderator Report this to a Moderator
 10-May-2004 20:26
User is offline View Users Profile Print this message


Catherine Yan

Posts: 43
Joined: 4-Aug-2003

Thanks again, Louie! You are the best!
Catherine
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.