![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: How do I create a trigger? Topic Summary: How to createa trigger from the beginning Created On: 6-Dec-2007 23:38 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I would like to create a trigger that will force certain users to open a specific module in shareable-edit mode only. I know that I should create a trigger to do this but I have no idea how to create a trigger. The dxl reference manual has code but it doesn't tell me where to put this code. Do I open up the module and go to Module Properties or something and put it there? I looked through all the manuals and there was nothing on where to put trigger code.
Any advice would be greatly appreciated. Thanks, Kevin |
|
![]() |
|
![]() |
|
hmm, I have this somewhere. Will post it on monday if no one else does it first.
------------------------- Andrew Tagg Thales Air Systems, Melbourne Australia. andrew.tagg@thalesatm.com |
|
![]() |
|
![]() |
|
There is no GUI method of dealing with Triggers, you must use DXL to deploy and to delete Triggers. That means you [1] create the code of the trigger itself [2] create another DXL whose job it is to deploy the trigger. This deploy code should also provide a mechanism for deleting the trigger. Presumably the Deploy trigger need only exist on your client, since you only need it to deploy and delete, you don't need it during the life of the trigger.
[1] Create the Trigger code. You have several options here. [1a] put the code in a separate file and #include it in the trigger. I dislike this alot since the #include file would need to be available to all users of the module, meaning the network location you put it must be readable by all users. [1b] put the code in a separate file and user 'readFile' to get it into the deploy code. This is a great option for complicated Triggers, but has the disadvantage that you have 2 files to maintain for the trigger (Deploy dxl and the Trigger dxl). [1c] code the trigger inside the 'trigger(...)' command. This makes your deploy code hopelessly confusing [1d] define a string variable that has the DXL code in it; and the 'trigger(...)' command uses that variable. This is the option I use most often. [2] Create the Deploy code. This code should look something like this: string TriggerDXL = [1b] readFile(NameOfFile); or [1d] "bla bla bla trigger code" string TriggerName = "NameOfTrigger" if ("Remove Trigger '" TriggerName "'??) delete(TriggerName, module, post, open, 10) if ("Deploy Trigger '" TriggerName "'??") { Trigger trg = trigger(TriggerName, module, post, open, 10, TriggerDXL) if (null trg) infoBox(TriggerName " didn't seem to get deployed") } If you change the parameters of the trigger, be sure to delete the trigger before changing the deploy code; otherwise the 'delete' command won't find the trigger. I didn't try the attached code, but it should get you started; presuming you intend to deploy this trigger in a particular module. In the 'DxlTrig' variable, take notice that double quote and slash characters need to be 'escaped' by prefix with a slash. Run the attached for each Edited module you want the trigger to run. This particular trigger is particularly tricky, since you must have the module open Edit in order to deploy or remove the trigger, but the trigger disallows Edit. Thus, the Trigger itself should provide a mechanism for opening Edit. In this case I've chosen the Administrator, folks with module RMCDA access, or DB Managers. Please post the code after you've fixed it. - Louie |
|
![]() |
|
![]() |
|
Louie,
Thank you so much for all the time and effort you put into explaining this to me. I found it to be very well thought out and it seems like it will be very helpful. I haven't tried it out yet but I will today. Thank you so much again. I didn't expect much help from this forum but you definitely proved me wrong. I will post the code when it is finished. Sincerely, Kevin |
|
![]() |
|
![]() |
|
Hi Louie,
I thought I'd let you know that I've found this useful as well. I was at a loss when trying to create a trigger, so thanks for your post. Dominic |
|
![]() |
Telelogic DOORS
» General Discussion
»
How do I create a trigger?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.