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: Return Type for Persistent Triggers
Topic Summary:
Created On: 18-Aug-2004 17:17
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 Monday, August 23, 2004 12:40 PM

Answer:
Dynamic triggers call a FUNCTION to do the work. Such functions can return a value.

Persistent triggers call a DXL PROGRAM to do the work. Programs cannot return a value. You have no place to "go" from such a program.

However, "pre" event persistent triggers let you decide from inside the trigger whether or not the triggering event actually happens. If you have a pre-module-open trigger, the trigger CAN disallow the module-open (such as after checking the user's RMCDA rights). Look for "trigPreConPass" in the DXL manual.

- Louie
 18-Aug-2004 17:17
User is offline View Users Profile Print this message


Andrew Mellinger

Posts: 31
Joined: 11-Aug-2004

So I've been working a variety of persistent triggers, and for reasons of flow, I'd like to return from inside my persistent trigger.

I've tried a variety of return types:

-none
-true
-false
-0
-1
-""

but I always get a error of "incorrect return type" for the trigger. Does anyone know what the correct return type is?

-Andrew
Report this to a Moderator Report this to a Moderator
 19-Aug-2004 16:24
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer Answer
Dynamic triggers call a FUNCTION to do the work. Such functions can return a value.

Persistent triggers call a DXL PROGRAM to do the work. Programs cannot return a value. You have no place to "go" from such a program.

However, "pre" event persistent triggers let you decide from inside the trigger whether or not the triggering event actually happens. If you have a pre-module-open trigger, the trigger CAN disallow the module-open (such as after checking the user's RMCDA rights). Look for "trigPreConPass" in the DXL manual.

- Louie
Report this to a Moderator Report this to a Moderator
 20-Aug-2004 19:02
User is offline View Users Profile Print this message


Andrew Mellinger

Posts: 31
Joined: 11-Aug-2004

Louie,

Thanks for the response. I've been using the set routine to set the return state and that works well. What I am trying to do is to leave my trigger from the middle of its execution. (e.g. return or exit.) I can't find a way to exit from within my trigger. For example:


if (o."State" == "Draft")
{
blah blah
return
}

other code...

Whenever I have that return in there, I get the error of incorrect return type.

-Andrew
Report this to a Moderator Report this to a Moderator
 20-Aug-2004 22:12
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You "return" from a function to go back to the caller. You "halt" to quit execution.

"Halt" should be fairly routine in your DXL programs. All my Module DXL code has the following at the top:
Module g_mCurr = current
if (null g_mCurr){ack("Run from open module"); halt}

Most of the non-module code checks for a current project.

Another reasonable possibiltiy, for code that modifies the module, is:
if (!isEdit(g_mCurr)){ack("Open module for Edit"); halt}

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