Doors in batch mode opens new command window

When I run Doors in batch mode from a command prompt it exits immediately and opens a new command window where the output is printed. This won't work for a headless run from a continuous integration server. I need the output from Doors in batch mode on standard out and/or standard error.

This is how I execute Doors:

doors.exe -user XXXX -password YYYY -batch script.dxl

How can I have the output from Doors to standard out and/or standard error in my original command window?
autotom - Tue Sep 07 01:41:15 EDT 2010

Re: Doors in batch mode opens new command window
autotom - Tue Sep 07 08:19:00 EDT 2010

I was wrong in stating that Doors exits immediately: It doesn't. It waits for the newly opened command window to exit.

So the problem remains. Isn't it weird of a command line interface to open new windows?

(I'm on Microsoft Windows by the way.)

Re: Doors in batch mode opens new command window
SystemAdmin - Tue Sep 07 08:44:10 EDT 2010

autotom - Tue Sep 07 08:19:00 EDT 2010
I was wrong in stating that Doors exits immediately: It doesn't. It waits for the newly opened command window to exit.

So the problem remains. Isn't it weird of a command line interface to open new windows?

(I'm on Microsoft Windows by the way.)

The search for "doors batch mode" found this thread

Re: Doors in batch mode opens new command window
autotom - Tue Sep 07 08:59:55 EDT 2010

SystemAdmin - Tue Sep 07 08:44:10 EDT 2010
The search for "doors batch mode" found this thread

Thanks, I've read that thread and the -W flag (which I guess is equivalent to -nowait) helps in that the newly opened command window is automatically closed instead of waiting for the user to press return.

However, what I need is a flag that executes the DXL in my original command window (instead of in a different process in a different window), so that I can access standard out and standard error. As it works now, I have no way of accessing the output from the script.

So as before: the problem remains.

Re: Doors in batch mode opens new command window
llandale - Wed Sep 08 17:22:49 EDT 2010

Don't use print statements. Instead send your output to a buffer, and at the end of your script sent the buffe to a file. Perhaps something like this:

string NameOutFile = "C:\\Doors-Stuff\\BatchOutput.txt"
Buffer g_bufOutput = create()
 
void print(string Message)
{  g_bufOutput += Message
}
 
void FileMessages()
{  Stream out = write(NameOutFile)
   out << g_bufOutput
   close(out)
   system("Notepad.exe " NameOutFile)
   delete(g_bufOutput)
}


I see standard streams 'cin', 'cout', and 'cerror', but I don't understand them at all.

 

 

  • Louie

 

 

Re: Doors in batch mode opens new command window
Mathias Mamsch - Wed Sep 08 19:35:45 EDT 2010

autotom - Tue Sep 07 08:59:55 EDT 2010
Thanks, I've read that thread and the -W flag (which I guess is equivalent to -nowait) helps in that the newly opened command window is automatically closed instead of waiting for the user to press return.

However, what I need is a flag that executes the DXL in my original command window (instead of in a different process in a different window), so that I can access standard out and standard error. As it works now, I have no way of accessing the output from the script.

So as before: the problem remains.

You can use cin and cout to output stuff to the stdout. You can issue the flush() command to be able to fetch the output even while the DXL is running. print does not seem to be redirected by default. Hope this helps, regards Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Doors in batch mode opens new command window
autotom - Fri Sep 10 02:47:11 EDT 2010

Mathias Mamsch - Wed Sep 08 19:35:45 EDT 2010
You can use cin and cout to output stuff to the stdout. You can issue the flush() command to be able to fetch the output even while the DXL is running. print does not seem to be redirected by default. Hope this helps, regards Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

OK, cout and cerr works for me. I also found out that it is the print statement that causes a new command prompt window in Windows to be opened. If I remove all print commands from my DXL script, no window is opened.

Thanks.

Re: Doors in batch mode opens new command window
Mathias Mamsch - Fri Sep 10 06:57:36 EDT 2010

autotom - Fri Sep 10 02:47:11 EDT 2010
OK, cout and cerr works for me. I also found out that it is the print statement that causes a new command prompt window in Windows to be opened. If I remove all print commands from my DXL script, no window is opened.

Thanks.

As an additional trick you can redefine the prints before starting the script. This way you can redirect the output of every script to the stdout.
 

// Put this code to a file called 'redirection.inc'
void print (Date d) { cout << d "" }
void print (string s) { cout << s }
void print (int i) { cout << i "" }
void print (char c) { cout << c "" }
void print (bool b) { cout << b "" }
void print (real r) { cout << r "" }

 


Then you could launch your script like: doors.exe -b yourscript.dxl -D "#include <redirection.inc>" -u User -p Password
which might work (I did not actually try it I am positive it will do the trick).

Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Doors in batch mode opens new command window
RushiW - Wed Sep 15 09:02:17 EDT 2010

Mathias Mamsch - Wed Sep 08 19:35:45 EDT 2010
You can use cin and cout to output stuff to the stdout. You can issue the flush() command to be able to fetch the output even while the DXL is running. print does not seem to be redirected by default. Hope this helps, regards Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Hello, I am facing same issue. I tried the solution that u suggested, but its not working for me.
Could you please explain this in detail?

I have one dxl file with following code in it.

print "Hello using print"
cout << "Hello using cout"

 


I am running this script from machine where I have installed doors client. I am using following command to execute the script.
doors.exe -d <port@server_name> -u XXXX -p YYYY -b script.dxl

But I could not see any output on stdout (i.e. "Hello using cout")

 

Re: Doors in batch mode opens new command window
BillTidy - Fri Apr 20 06:40:52 EDT 2012

We are now running into this problem in testing batch scripts in DOORS 9.3

We still have an 8.2 DOORS running.

The batch works fine in 8.2 but we get a popup in 9.3 - there are NO print statements in the DXL.

--> Has anyeone else experienced this different behaviour between 8.2 and 9.3 bathc modes when piping output to cout?
Did you find a solution?
TIA.

Re: Doors in batch mode opens new command window
BillTidy - Fri Apr 20 08:32:42 EDT 2012

BillTidy - Fri Apr 20 06:40:52 EDT 2012
We are now running into this problem in testing batch scripts in DOORS 9.3

We still have an 8.2 DOORS running.

The batch works fine in 8.2 but we get a popup in 9.3 - there are NO print statements in the DXL.

--> Has anyeone else experienced this different behaviour between 8.2 and 9.3 bathc modes when piping output to cout?
Did you find a solution?
TIA.

Problem partly solved. A parameter was not being passed correctly but we still have the problem that nothing is being shown over cout (standard out).