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: Error handling in DXL
Topic Summary:
Created On: 2-Jun-2008 17:43
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.
 2-Jun-2008 17:43
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

Hi all,
This post relates to some other posts I have made earlier on this forum. I run scripts on a nightly basis. I essentially set up scheduled tasks that trigger .BAT files, which in turn, launch DOORS and execute a specific DXL script. If the script fails, its corresponding scheduled task is shown as still "Running" in the "Scheduled Tasks" section. I have no way of establishing why the script failed. I tried adding an "error capture" segment to my scripts. Unfortunately, this segment only captures the last error (if and when it works). This is not very helpful at all. My mechanism for "error" capture is as follows:

noError()

//Main Program

string errmsg = lastError()

At the end of the program, I write the value of the "errmsg" variable to a .txt file. Unfortunately, quite often, the value of errmsg does not get updated. As a result, when I look at this .txt. file, it sometimes gives me the false impression that the script ran just fine. Any idea how I might work around this? Furthermore, if the script gets stuck, is there some way to force the script to end, and kill the instance of DOORS triggered via the scheduled task? Any input would be highly appreciated. Thank you.

Regards,

Pranav
Report this to a Moderator Report this to a Moderator
 2-Jun-2008 18:51
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

In my .bat files after each DOORS process is started, I have the following line to forcibly kill the DOORS process should it not end.

TASKKILL /F /IM DOORS.EXE

Make sure you have the /WAIT command in your DOORS start command or it'll execute right after the DOORS command.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 2-Jun-2008 18:54
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

And you can also use the command

eval_("exit_()")

to close DOORS if you get an error. You wrap it in eval to make sure it happens since it sometimes won't work.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 2-Jun-2008 20:26
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I may not remember this correctly since its been a couple years since I batched anything.

Bounding your entire script with noError/lastError doesn't seem reasonable.

The DOORS batch file remains active when there is DXL output, which can get generated with print statements or of course DXL errors. When I'd come in in the morning I could see the DXL output pane and see the errors that my nighttime batch programs generated. My notes suggest that the DXL output window looks like a black DOS window. I found that useful, especially for debugging since I could put print statements in my batch code and was sure to see the prints and the errors in the morning. Are you sure you don't see your errors in this window the morning after your batch fails?

Use of the "-logfile" command line switch, pointing to a file, may trap DXL errors without use of this extra DXL output window. I have a nagging memory of having some trouble with this switch.

- Louie
Report this to a Moderator Report this to a Moderator
 3-Jun-2008 19:36
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

@David:
I will try adding the line in the .bat file to kill the DOORS process.

@Louie:

The DXL output pane is not visible in the morning. I wonder if it has something to do with the fact that script execution is triggered via a scheduled task. Ideally, something like the "-logfile" command you mentioned would work great for me. What exactly is the syntax for this command?
Report this to a Moderator Report this to a Moderator
 3-Jun-2008 21:22
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

In your *.bat file you will have something that looks like this:
..\Telelogic\DOORS_8.3\bin\doors.exe" -b "c:\MyDxl.dxl" -logfile "c:\MyLogs\MyDxl-log.txt"

- Louie
Report this to a Moderator Report this to a Moderator
 5-Jun-2008 16:15
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

We also do nightly batch jobs that run DXL. If I recall correctly, we fire off a perl script to do a bunch of different build/metrics tasks, and one of the things it does is run DOORS in batch mode. (The perl script may be part of the reason it behaves the way it does, or maybe not.)

If there is a DXL problem, a lot of the time it will leave an empty black DOS window on the screen, and pressing Enter will dismiss it. Sometimes in batch mode I've seen it print the DXL errors (or print statements) to the DOS window; other times it has errors but you can't see them. I'm not sure I ever figured out why, though I haven't looked into it that much. At the very least, I have seen what you have described.

Chris
Report this to a Moderator Report this to a Moderator
 9-Jun-2008 18:33
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

I guess I will try adding the line that writes the log to a text file via the batch file. Thanks a lot.

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