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: Help with Trigger
Topic Summary: Does not seem like trigger is firing
Created On: 8-Aug-2007 21:37
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.
 8-Aug-2007 21:37
User is offline View Users Profile Print this message


James Cesari

Posts: 3
Joined: 2-Aug-2007

Hello,

        I am trying to get this trigger to function when I change a certain attribute.  When it triggers it should activate some code which I have tested and does work which would generate an ID number for another attribute.  I click on the file with the trigger to set it up, but it just does not do anything.  I change the attribute and it does nothing, and I've checked with some trigger validation ideas I've found around here and it does not seem to even be running at all.  Am I trying to do something that is not possible?  Is my script wrong?  Or is there more to adding the trigger than just these two lines?

NOTE: I added the delete trigger first in the file so I wouldn't get like 10 of the same trigger firing if that is possible, I have also tried to set it up in a more object like way:
Trigger trg = trigger()
But it does not help anything.  This is my current script to activate the trigger:


delete("Trigger Name", attribute->"Attribute Name", post, modify, 1)

trigger("Trigger Name", attribute->"Attribute Name", post, modify, 1, "dxlCode")

Report this to a Moderator Report this to a Moderator
 8-Aug-2007 21:53
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Your "dxlCode" needs to be actual DXL code. See attached for an example. The DXL code starts in line #10 and ends in line #37. Take notice that back slashed in the code must be escaped with another back slash, as must double quotes. That is...
that is this: print "Help\n"
becomes this: print \"Help\\"\"

That's clumsy. The alternative is to write the DXL in a data file and have your deploy dxl do thisL
string DXL = readFile("c:/MyStuff/MyCleverDXL.dxl").

Notice the use of "checkDXL" in line 39 to make sure that the DXL at least interprets without errors.

Not sure what would happen if you attempt to create a new Trigger when its already there with the same name and parameters. Give it a try I believe you'll find the new one does NOT take hold.

Not sure what will happen with your code if you run it outside of a module. I suppose it SHOULD take hold in the project and apply to all modules, but your 'level' should be explicit: project->module->all-attribute->"Attribute Name" if that's your intention. You probably want to run it from inside a module and apply it to THAT module only, in which case the deploy DXL should first check for a current module (as in the example).

You also probably want to make it a pre modify attribute trigger. Post means the event is already over and you won't be able to find out which attribute fired. Your pre-attr trigger should issue: set(trigPreConPass) unless it really figures to prevent the change, in which case it issues set(trigPreConFail).

- Louie
Report this to a Moderator Report this to a Moderator
 8-Aug-2007 23:08
User is offline View Users Profile Print this message


James Cesari

Posts: 3
Joined: 2-Aug-2007

Alright, thank you.  I think I understand it all a bit better.  For right now I'm just trying to use it on one module, and I actually do have my code in a seperate file.  So I will give it a few more shots, and thank you!
Report this to a Moderator Report this to a Moderator
 9-Aug-2007 15:55
User is offline View Users Profile Print this message


James Cesari

Posts: 3
Joined: 2-Aug-2007

<EDIT> Everything is working well now thank you for the help again Louie



Edited: 9-Aug-2007 at 21:47 by James Cesari
Report this to a Moderator Report this to a Moderator
 30-Aug-2008 16:22
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Hi,
I wrote a DXL dcript to display "Non System Gererated attributes". I am displaying the Attribute List in a Dilalog Box, Now I want to apply triggers to only selected Attributes from the dialog box, not for "all". Could you help me?

Trigger t = trigger("Test",module->current Module ->attribute-> "Selected Name", pre, open, 10, "#include <triggers/projOpen>")
Report this to a Moderator Report this to a Moderator
 29-Oct-2008 08:30
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

I found answer for my question.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.