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: Post-Save Trigger
Topic Summary:
Created On: 2-Jun-2003 21:38
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.
 2-Jun-2003 21:38
User is offline View Users Profile Print this message


Mark Boltuc

Posts: 3
Joined: 21-Apr-2003

I'm relatively new to DXL / DOORs and was wondering how to go about creating a post-save trigger that would launch a piece of dxl code.?

Also is there any good reference places for DXL programming?

Thanks in advance,
Mark
Report this to a Moderator Report this to a Moderator
 13-Jun-2003 20:23
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

string DXLCode = "yaddy yaddy"
string NameTrig = "Yaddy"
// Delete the trigger in case it already exists
string ErrMess = delete(NameTrig, module->current, post, save, 5)

Trigger trg = (NameTrig, module->current, post, save, 5, DXLCode)

The above deletes the trigger in the current module then creates a new one.

The tricky part is the DXL code, since you have to be code in slashes and quotes with extra slashes: if you want the first line type the second:

1 \\ Putting a couple "quotes" in a comment
2 \\\\ Putting a couple \"quotes\" in a comment

DXLCode =
"Module mCurr = current
string NameCurr = name(mCurr)
\\\\ Now say goodbye:
ack(\"Closing module '\" NameCurr \"'. GoodBye\")
\\\\ end trigger code"

It gets even stickier if the DXL that is creating the trigger wishes to insert some information into the trigger code, such as the name of the person who created the trigger. Good luck sorting out THOSE slashes and quotes.

- Louie
Report this to a Moderator Report this to a Moderator
 17-Jun-2003 16:56
User is offline View Users Profile Print this message


Roy Bond

Posts: 39
Joined: 25-Mar-2003

Select 'Tools' 'Edit DXL...' from inside the Formal Module.

Enter the following in the DXL editor :

trigger( "Post_Save_Trigger", module, post, save, 1, "#include <PATH_TO_DXL/DXL_FILE.dxl>" )


Hit 'Run'

The Trigger is now embedded in that Formal Module.

Save the Module. You must do this to save the embedded Trigger, but in this case the Trigger will also fire and try to execute the DXL in the the expression PATH_TO_DXL/DXL_FILE.dxl.

Hope this helps.

Roy.



PS Just been reading DXL Reference Manual and found a table which defines what triggers are available for which items. (See "Basic trigger events"). In short, it says you can't have a post save trigger on a Module.

Edited: 23-Jun-2003 at 15:27 by Roy Bond
Report this to a Moderator Report this to a Moderator
 24-Jun-2003 17:05
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes, putting the static DXLCode in a file and including it is probably better than my method.

But wait!!! It just occured to me that your method could ALSO be used to delete an unwanted trigger. When you are done with it just replace the DXL included file with "delete(current Trigger); save(current Module)", so if the trigger fires it deletes itself. Boy, that makes trigger management a lot easier. May even obsolete my "TriggerDelete.dxl" program that goes around looking for triggers offering to delete them.

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