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: Triggers: Which attr is being edited?
Topic Summary:
Created On: 25-Sep-2002 21:14
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.
 25-Sep-2002 21:14
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 26-Sep-2002 04:13
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 30-Sep-2002 20:40
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 1-Oct-2002 01:25
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

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