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: More Trigger Help
Topic Summary:
Created On: 25-Jan-2003 04:20
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-Jan-2003 04:20
User is offline View Users Profile Print this message


Janet Ma

Posts: 115
Joined: 12-Sep-2002

Does anybody know how to create a trigger on attribute update which tests another attribute? I want to test if a "comments" attribute is filled out when the "Decision" attribute is changed to "Approved", but defaults back to its previous value if the "Comments" remains empty. I don't know whether to use the pre or post attribute modify trigger.

Any ideas?
Report this to a Moderator Report this to a Moderator
 25-Jan-2003 23:18
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Looks like it needs to be a "pre save attribute" trigger. The "level" would include the "Decision" attribute: "module -> NameMod -> attribute -> "Decision"
Thus, the trigger fires when "Decision" is ABOUT to be changed. The "pre" part means the trigger is empowered to allow to disallow the change.

The body of the trigger may be as attached; keeping in mind that in order to implement a " and a / you need to use extra /. So in DXL "Decision" becomes /"Decision/" in DXL that going into a trigger.

- Louie
Report this to a Moderator Report this to a Moderator
 28-Jan-2003 16:36
User is offline View Users Profile Print this message


Janet Ma

Posts: 115
Joined: 12-Sep-2002

Louis:

...
if (ValDecision == "Approved" and null ValComments)
set trigPreConFail // Don't let user save the Decision attr
else set trigPreConPass

Are trigPreConFail and trigPreConPass triggers you write yourself or built-in DOORS triggers you can call up?

Janet
Report this to a Moderator Report this to a Moderator
 28-Jan-2003 18:11
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

"Find" them in the DXL online-help (not available from the DXL window, but available from the main DOORS help menu).

They are constants that define the "output" of "pre" triggers. Recall that "pre" means the trigger can decide if the event actually happens. Well, these constants are used to do just that.

If you define a "Pre Open Module" trigger and in the trigger sets "preConFail", then the module does NOT open. In this case, preConFail will prevent the "save" from occuring and the user's edits are lost. Just like a function that returns a value (as opposed to a "void" function), you need to set one of these values in all "Pre" triggers.

"Post" triggers occur AFTER the event, and have not "output" like this.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.