Errors in DXL Interaction Screen when connecting through C#

Errors displaying when a dxl is trying to execute through C# environment, but the same dxl is working fine when I use it directly with DOORS. The code I used in C# is as follows:

if (Process.GetProcessesByName("doors").Length == 0)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName= "C:\\Program Files (x86)\\IBM\\Rational\\DOORS\\9.3\\bin\\doors.exe";
proc.StartInfo.Arguments = "-u ala12 -P a123#";
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.WaitForInputIdle();
}
DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();
string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" oleSetResult #include <E:/AnithaL/test1.dxl>\"";
x.runStr(DXLStr);

*****************************
test1.dxl contains very simple code, just for a trial.
int max(int a, int b) { if a incorrectly concatenated tokens
-E- DXL: <Line:1> undeclared variable (b)
-E- DXL: <Line:1> undeclared variable (P)
-E- DXL: <Line:1> undeclared variable (u)
-E- DXL: <Line:1> undeclared variable (Doors)
-I- DXL: All done. Errors reported: 5. Warnings reported: 0.
Please correct me if anything is wrong.

SystemAdmin - Tue Mar 05 08:01:16 EST 2013

Re: Errors in DXL Interaction Screen when connecting through C#
llandale - Tue Mar 05 12:20:58 EST 2013

Your command line is invoking DOORS with user password and batch command. DOORS will start, run it, and end. You therefore don't need all that get-doors.exe-handle stuff in your "if" statement.

Your code didn't come through correctly. But it sure looks to me that your batch command resembles this:
  • oleSetResult int max(int a, int b) {if a bla bla bla}
It thus looks to me like you are sending function "max" to function "oleSetResult" which really should not work.

If the unprinted part of your code looks like this:
  • c = max(5, 4)
then perhaps your batch command can look like this:
  • -b \" #include <E:/AnithaL/test1.dxl>; oleSetResult(c) \"";
x.runStr(DXLStr);

-Louie

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Wed Mar 06 01:05:48 EST 2013

llandale - Tue Mar 05 12:20:58 EST 2013
Your command line is invoking DOORS with user password and batch command. DOORS will start, run it, and end. You therefore don't need all that get-doors.exe-handle stuff in your "if" statement.

Your code didn't come through correctly. But it sure looks to me that your batch command resembles this:

  • oleSetResult int max(int a, int b) {if a bla bla bla}
It thus looks to me like you are sending function "max" to function "oleSetResult" which really should not work.

If the unprinted part of your code looks like this:
  • c = max(5, 4)
then perhaps your batch command can look like this:
  • -b \" #include <E:/AnithaL/test1.dxl>; oleSetResult(c) \"";
x.runStr(DXLStr);

-Louie

Thanks for the reply.
I have changed the code as follows:

DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();
string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";
x.runStr(DXLStr);

Still getting the same DXL errors.
-E- DXL: <Line:1> incorrectly concatenated tokens
-E- DXL: <Line:1> undeclared variable (b)
-E- DXL: <Line:1> undeclared variable (P)
-E- DXL: <Line:1> undeclared variable (u)
-E- DXL: <Line:1> undeclared variable (Doors)
-I- DXL: All done. Errors reported: 5. Warnings reported: 0.

test1.dxl contains
int max(int a, int b)
{
if a < b then
return b
else
return a
}
print max(4,5)
Please tell me which part is wrong.

Re: Errors in DXL Interaction Screen when connecting through C#
llandale - Thu Mar 07 15:38:33 EST 2013

SystemAdmin - Wed Mar 06 01:05:48 EST 2013
Thanks for the reply.
I have changed the code as follows:

DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();
string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";
x.runStr(DXLStr);

Still getting the same DXL errors.
-E- DXL: <Line:1> incorrectly concatenated tokens
-E- DXL: <Line:1> undeclared variable (b)
-E- DXL: <Line:1> undeclared variable (P)
-E- DXL: <Line:1> undeclared variable (u)
-E- DXL: <Line:1> undeclared variable (Doors)
-I- DXL: All done. Errors reported: 5. Warnings reported: 0.

test1.dxl contains
int max(int a, int b)
{
if a < b then
return b
else
return a
}
print max(4,5)
Please tell me which part is wrong.

[1] You are openning a connection to DOORS and sending the following string to execute:
  • Doors -u "ala12" -P "a123#" -b " #include <E:/AnithaL/test1.dxl>;oleSetResult(c)"
Well, token "Doors" looks like a variable yes? Execute that manually and see what happens.

I think you want to send DOORS just this part:
  • #include <E:/AnithaL/test1.dxl>;oleSetResult(c)

[2] Your original command does not presume an existing DOORS process and should be sent to the operating system; changing "Doors" to "Doors.exe", and adding the path; telling it to start that new process with those command switches.

I think solution [1] is what you want.

-Louie