![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Trigger repeat 'firing' Topic Summary: Created On: 24-Jun-2004 09:00 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: ![]() Sorted the problem out, now......Like a dummy I forgot that triggers remain active per DOORs sessions and not per DXL program. Each time I ran the DXL script and subsequently de-bugged it a instance of the trigger was produced. When I closed the DOORs session and re-started the DOORs application the Triggers worked just the once as advertised. Have now added a close function to the dialog box which contains:- Trigger t for t in database do{ delete t } This makes sure that the triggers are deleted at the end of each execution. | |
![]() |
|
Hi,
I have wirtten a small DXL program to be used when testing DXL scripts, The code was suppposed to have detected a module opening event, then issue a on screen warning and write to an alreaady opened stream. The problem is that it appears to fire multiple times. when one module is opened. The result is the stream file contains 4 or 5 entries for the one event. The code is included below:- bool preModOpen(Trigger trgModuleOpen) { mod_Name = module(Trigger trgModuleOpen) trigType = type(Trigger trgModuleOpen) ack ("WARNING! " mod_Name " Module is about to be opened!") output << mod_Name "\n" return } Trigger trgModuleOpen = trigger ( module -> all,open, 2, preModOpen ) Any ideas ?? Dave mc |
|
![]() |
|
![]() |
|
Dave,
It is normal for DOORS to open other modules when a single module is opened, if that single module has a Layout DXL traceability column in it's default view. One trick is to have your trigger code only respond to modules that are opened visible, or only opened for edit. The isVisible() and isEdit() commands can help. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
|
![]() |
|
Sorry,
probably didn't make it clear, the stream output indicates that it is the same module opening multiple times , yet in re-ality the module only actualy opens once......... Dave |
|
![]() |
|
![]() |
|
There are multiple output lines but only one "ack"?
You ought to declare your variables: lets not point unloaded guns. There are two "module(trigger)" commands; one returns a string and the other a Module handle. I suppose it figured out the correct one from your code. The string = module(Trigger) command returns the module that is opening? I haven't had perfect luck with the "module = current" command inside a trigger figuring out the module that triggered the trigger, since it won't work for "pre" triggers and sometimes it grabs a just opened link module as current (the trigger fires independantly with the opening of link partners). The function should return(true). I suspect Sutherland's comments apply: multiple modules are opened but the module(trigger) command is not what you think it is. I'd find out the name of the current module inside the trigger and output that (if not null) as well as the "module(trigger)", just to see if there is a difference. Otherwise perhaps you've got multiple triggers deployed simultaneously. Triggers are tricky, the commands are flaky, and the documentation is inadequate and faulty. I doubt there are any true "trigger" experts anywhere. Good luck. - Louie |
|
![]() |
|
![]() |
|
![]() Sorted the problem out, now......Like a dummy I forgot that triggers remain active per DOORs sessions and not per DXL program. Each time I ran the DXL script and subsequently de-bugged it a instance of the trigger was produced. When I closed the DOORs session and re-started the DOORs application the Triggers worked just the once as advertised. Have now added a close function to the dialog box which contains:- Trigger t for t in database do{ delete t } This makes sure that the triggers are deleted at the end of each execution. |
|
![]() |
|
![]() |
|
Your delete loop is prone to errors. For one thing if you define a "module-all" trigger while a project is open, I believe its stored in the Project and NOT in the DB. User "project->all->module-all" to insure its in the DB. For another you'll delete other folks triggers, who may have defined a persistent one. Perhaps you want to add some sort of "is it dynamic" test before deleting it.
- Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Trigger repeat 'firing'
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.