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: excluding a attribute from a trigger
Topic Summary: excluding a attribute from a trigger
Created On: 15-Sep-2005 16:44
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.
Answer This question was answered by Louie Landale, on Friday, September 16, 2005 3:45 PM

Answer:
History might work so long as the attribute records history and the trigger is a POST attribute save trigger. Or you can read the invisible ink in the manual and do something like this inside the trigger:

Trigger trg = current
AttrDef ad = attrdef(trg)
string NameAttr = ad.name
if (NameAttr is to be excluded) halt.

Yes, the "attrdef(trg)" command returns the def of the attribute that triggered the attribute-save trigger.

That fact makes attr-save triggers a lot more useful. I beat my head against the wall for a long time, then decided to try ALL the trigger commands inside all kinds of triggers, just to see what they REALLY do.

- Louie
 15-Sep-2005 16:44
User is offline View Users Profile Print this message


martin allman

Posts: 74
Joined: 25-Jul-2005

I have set a trigger within my module to fire when ANY attribute within a module changes

project ->pName ->module -> xName ->attribute ->all

 I would like to exclude a certain attribute call it A from setting the trigger off, but am not sure how to do this.

Thanks for any help

 

 

Trigger attr1 = trigger("ModObjTxt", project ->pName ->module -> xName ->attribute ->all, post, save, 10 ,dxl)

Report this to a Moderator Report this to a Moderator
 15-Sep-2005 17:26
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

Don't think you can exclude at this level. You might have to modify the dxl directly. The dxl would find the last change in the history and if the attribute was the excluded one, then exit the dxl.

This depends :
a. If the attribute definition includes - change history; and
b. If the object history is modified prior to the execution of the dxl.

It would probably be easier to set the trigger only for those attributes needed:
eg.
AttrDef ad
Trigger attr1
for ad in current module ..
if (ad.name != "whatever" ) attr1 = ....
}

-------------------------
Cliff Bly
Report this to a Moderator Report this to a Moderator
 15-Sep-2005 23:28
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer Answer
History might work so long as the attribute records history and the trigger is a POST attribute save trigger. Or you can read the invisible ink in the manual and do something like this inside the trigger:

Trigger trg = current
AttrDef ad = attrdef(trg)
string NameAttr = ad.name
if (NameAttr is to be excluded) halt.

Yes, the "attrdef(trg)" command returns the def of the attribute that triggered the attribute-save trigger.

That fact makes attr-save triggers a lot more useful. I beat my head against the wall for a long time, then decided to try ALL the trigger commands inside all kinds of triggers, just to see what they REALLY do.

- Louie
Report this to a Moderator Report this to a Moderator
 16-Sep-2005 11:00
User is offline View Users Profile Print this message


martin allman

Posts: 74
Joined: 25-Jul-2005

Louie

Thank you for your response. The block below shows my existing trigger code: I have a attribute named "Test Review Status" this is shown in a drop down text box within the module view and

can take various string values. If any attributes are changed and saved I want the drop down to default back to "Unchecked". The problem

is if I drop down the text box "Test Review Status" it will automatically default back to "Unchecked", hence I wanted to exclude this particular

attribute from the action of the trigger. I can see that your code will do that but I am not sure how to integrate that into my trigger code.

Would be very grateful if you could help me

Thanks Martin

///////////////////////////////////////////////////////////////////////

 

Project px = current

string pName = fullName(px)

Module m = current

string xName = name(m)

string dxl = "Object o = current Object"

 

dxl = dxl "\n" "o.\"Test Review Status\" = \"Unchecked\""

 

Trigger attr1 = trigger("ModObjTxt", project ->pName ->module -> xName ->attribute ->all, post, save, 10 ,dxl)

Report this to a Moderator Report this to a Moderator
 19-Sep-2005 22:50
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Attached is more what I was thinking and also demonstrates a better way to define the trigger code. Some suggest using an #include statement but that requires all users to have access to the same network file, which is rarely the case.

Side comments: Your Trigger definition program should provide the ability to remove the trigger since no such mechanism exists in the user interface. Thus, trigger definition programs should tend to look like this:
string NameTrig = "SetToUnchecked"
if (confirm("Remove from system strigger '" NameTrig "'??"))
delete(trigger...)
if (confirm("Add to system trigger '" NameTrig "'??"))
Trigger trg1 = trigger(...)

Triggers. The Moby Dick of requirements management.

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