![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Triggers: Which attr is being edited? Topic Summary: Created On: 25-Sep-2002 21:14 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have a Trigger script designed to activate whenever an object in the module is "opened" by the user, presumably by double-clicking in a column in the view (trigger when someone starts to edit an attribute value). The trigger level is all objects in the module, type is "pre", event is "open".
I was wondering if anybody had any luck figuring out within the trigger which attribute being opened triggered the trigger? I can obviously figure out which Object using the 'current' command, but there appears to be no way to figure out which attribute is being edited. I don't think I can deduce it using the notion of a 'current' column, since that only applies when the column header has been selected. Alternatively, I suppose I could change the trigger to an Attribute Pre Save trigger (wait until they attempt to save a change to the attribute), but doubt that will help. A distasteful solution is to define a separate trigger for each attribute (at least the ones I care about); then use the 'current' trigger name to deduce the name of the attribute. Any ideas? - Louie Landale |
|
![]() |
|
![]() |
|
Louie,
There is a documented command: string attribute( Trigger t ) that gives that information. Pass it the handle of the current Trigger within the trigger code: string att_edited = attribute( current Trigger ) This only works in DOORS 5.1 and above. Below is the problem resolution statement from the "Problems fixed in DOORS 5.1" file that indicates this. 5998 It is now possible to define a trigger that fires when the user attempts to change the value of a specific attribute in a formal module. It is also possible to discover within the trigger handler the name of the attribute that the user is attempting to modify. michael@galactic-solutions.com ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
|
![]() |
|
As it did before this "attribute(current Trigger)" command is retuning null within the body of the trigger. I suspect that it actually returns the name of the attribute IF the trigger is defined as an specific attribute level trigger; but does not return the notion of "current attribute" which is what I need.
- Louie |
|
![]() |
|
![]() |
|
Louie,
Attached is a piece of code that worked for me before the attribute( Trigger t ) command was made to work in DOORS 5.1. The method involves looping through the History records to find the latest change, and getting the Attribute name from that. I have written some trigger management code that helps me eliminate the distasteful burden of creating and managing separate triggers for Attributes. Regards, ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Triggers: Which attr is being edited?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.