Topic
  • 3 replies
  • Latest Post - ‏2013-03-07T20:38:33Z by llandale
SystemAdmin
SystemAdmin
1084 Posts

Pinned topic Errors in DXL Interaction Screen when connecting through C#

‏2013-03-05T13:01:16Z |
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.
Updated on 2013-03-07T20:38:33Z at 2013-03-07T20:38:33Z by llandale
  • llandale
    llandale
    648 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-05T17:20:58Z  
    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
  • SystemAdmin
    SystemAdmin
    1084 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-06T06:05:48Z  
    • llandale
    • ‏2013-03-05T17:20:58Z
    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.
  • llandale
    llandale
    648 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-07T20:38:33Z  
    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