![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Post-Save Trigger Topic Summary: Created On: 2-Jun-2003 21:38 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Post-Save Trigger
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.