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: Anyone know how to Autorun a DXL when a module is opened?
Topic Summary:
Created On: 1-Apr-2004 23:42
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 Louie Landale, on Wednesday, April 14, 2004 2:17 PM

Answer:
Triggers are not for the feint of heart.

The attached code installs a Trigger that forces the user to confirm an "edit" or "share" open of the current module. Open the module Edit, run the code, and save the module. Notice that the Trigger is auto-deleted before the Confirm; so you can later remove the trigger by running the code and declining to confirm.

The tricky part of this is defining the DXL code that goes in the trigger. I've hard coded it in variable "TrigDXL". Notice the extra "/" characters in front of all the natural "/" and """ characters. Notice the syntax is a disaster to read; such is life. Someone else suggested putting the Trigger code in a file and reading it. This is a reasonable solution.

Notice its a "post open module" trigger. "Post" means the module IS opened regardless of what the trigger is doing (the trigger runs AFTER the event; open module in this case). If you want your trigger to decide if the user can open the module at all then use a "pre open module" trigger; and be sure add code in the trigger:

if I want to allow the user to open the module
then set(trigPreConPass)
else set(trigPreConFail) // Disallows the "event"; in this case opening the module.

If you want this code to run in all modules in the Project then make it a "post open project" trigger; or possibly a "post open database" trigger.

- Louie
 1-Apr-2004 23:42
User is offline View Users Profile Print this message


Carlton Rubio

Posts: 23
Joined: 22-Jan-2003

Hi All,

I am trying to find a way to run a DXL function every time a certain module is opened. I can't find any information on the type of startup.dxl or autorun.dxl I am looking for. Is there such an animal? I know there is a startup.dxl for the api, but I was hoping for one that is module specific. Any help would be appreciated.

Thanks
Carlton

Edited: 1-Apr-2004 at 23:43 by Carlton Rubio
Report this to a Moderator Report this to a Moderator
 2-Apr-2004 08:30
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

I suspect you want a trigger, but never having dealt with them, I can't be more specific. At least it's somewhere to start looking...

-------------------------


Paul dot Tiplady at TRW dot com
TRW Automotive
Report this to a Moderator Report this to a Moderator
 2-Apr-2004 14:41
User is offline View Users Profile Print this message


Carlton Rubio

Posts: 23
Joined: 22-Jan-2003

Thanks For that Paul, I will look into triggers...

If there are any other suggestions please let me know,

Thanks All, Appreciate the help
Report this to a Moderator Report this to a Moderator
 5-Apr-2004 18:02
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer Answer
Triggers are not for the feint of heart.

The attached code installs a Trigger that forces the user to confirm an "edit" or "share" open of the current module. Open the module Edit, run the code, and save the module. Notice that the Trigger is auto-deleted before the Confirm; so you can later remove the trigger by running the code and declining to confirm.

The tricky part of this is defining the DXL code that goes in the trigger. I've hard coded it in variable "TrigDXL". Notice the extra "/" characters in front of all the natural "/" and """ characters. Notice the syntax is a disaster to read; such is life. Someone else suggested putting the Trigger code in a file and reading it. This is a reasonable solution.

Notice its a "post open module" trigger. "Post" means the module IS opened regardless of what the trigger is doing (the trigger runs AFTER the event; open module in this case). If you want your trigger to decide if the user can open the module at all then use a "pre open module" trigger; and be sure add code in the trigger:

if I want to allow the user to open the module
then set(trigPreConPass)
else set(trigPreConFail) // Disallows the "event"; in this case opening the module.

If you want this code to run in all modules in the Project then make it a "post open project" trigger; or possibly a "post open database" trigger.

- Louie
Report this to a Moderator Report this to a Moderator
 14-Apr-2004 14:17
User is offline View Users Profile Print this message


Carlton Rubio

Posts: 23
Joined: 22-Jan-2003

Hey Louie,

Appreciate the response and the code. Yeah I know triggers are tough, when I started looking at them, my first thought was "is it worth the trouble". Your code at least shows me a guided path towards achieving my goal.

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