Topic
  • 11 replies
  • Latest Post - ‏2013-12-11T12:19:13Z by Mathias Mamsch
Searil
Searil
7 Posts

Pinned topic Running DXL script in the background

‏2013-11-27T14:05:10Z |

Hello everyone,

I have a dxl script which is running perfetly at DOORS Gui. But I want to run this .dxl script on the command line(cmd). 

When I write a a command like : 

%ProgramFiles%\IBM\Rational\ DOORS\9.3\bin\doors.exe" -d 23667@bi35 -u "xxx yyy" -P don -b "d:\workset\deneme\dene\addins\Devel\ exporterRTF.dxl

 

I am getting lots of errors. It is generally about "undeclared variable" or "incorrectly concatenated tokens". 

In my code i include like this => #include <utils/doctools/itfutil.inc>

and the problems genarally refer to this point. What should I do for working on command line ? Because normally it works when i try in the DOORS Gui.

 

Thanks in advance.

Updated on 2013-11-27T14:32:12Z at 2013-11-27T14:32:12Z by Searil
  • SudarshanRao
    SudarshanRao
    40 Posts

    Re: Running DXL script in the background

    ‏2013-11-28T16:51:07Z  

    Its difficult to comment without looking at the exact errors.

    But the file you refer to - itfutil.inc has quite a few functions that use DB/DBE (for example, DisplayInvalidChars), which aren't compatible to be run in batch mode. I'd suggest to pick just the functions you require for your DXL, use it in a different file and do an include on that file instead.

  • Searil
    Searil
    7 Posts

    Re: Running DXL script in the background

    ‏2013-11-28T17:16:49Z  

    Its difficult to comment without looking at the exact errors.

    But the file you refer to - itfutil.inc has quite a few functions that use DB/DBE (for example, DisplayInvalidChars), which aren't compatible to be run in batch mode. I'd suggest to pick just the functions you require for your DXL, use it in a different file and do an include on that file instead.

    I copied the error messages to below. I can do 2 things. One is first open the gui via command line, do some staff, close again the gui so i learnt that this is "Interactive Batch" or I start the .dxl script via command line always without gui. Actually if you explain more detailly what should i do for remove this error message i will happy because i am very new at this doors and I have to do this task in a little time.

    Remind : The dxl works fine at Gui, but when i try on command line everything is going wrong. I don't understand why it is like that. :/ 

    If you want I can also add the source code. 

    Thanks for helps.

     

    -E- DXL: <utils/doctools/itfutil.inc:25> (AHeading) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:26> (AShortText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:27> (ALongText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:29> (AName) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:78> (fontTable) already declared in this scope
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:102> incorrect arguments for (<<)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrectly concatenated tokens
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrectly concatenated tokens
    Included from:
    <Line:1> 
      too many messages -- suspending error reporting
  • SudarshanRao
    SudarshanRao
    40 Posts

    Re: Running DXL script in the background

    ‏2013-11-28T18:04:48Z  
    • Searil
    • ‏2013-11-28T17:16:49Z

    I copied the error messages to below. I can do 2 things. One is first open the gui via command line, do some staff, close again the gui so i learnt that this is "Interactive Batch" or I start the .dxl script via command line always without gui. Actually if you explain more detailly what should i do for remove this error message i will happy because i am very new at this doors and I have to do this task in a little time.

    Remind : The dxl works fine at Gui, but when i try on command line everything is going wrong. I don't understand why it is like that. :/ 

    If you want I can also add the source code. 

    Thanks for helps.

     

    -E- DXL: <utils/doctools/itfutil.inc:25> (AHeading) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:26> (AShortText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:27> (ALongText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:29> (AName) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:78> (fontTable) already declared in this scope
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:102> incorrect arguments for (<<)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrectly concatenated tokens
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrectly concatenated tokens
    Included from:
    <Line:1> 
      too many messages -- suspending error reporting

    There must be something different you're doing, to get the script to work in GUI.

    The errors in itself is because there are variables declared  in exporterRTF.dxl, which are also declared in itfutil.inc (AHeading, AShortText, ALongText, AName etc), which needs removed from one of these and managed in some other way. There could be more such conflicts/errors, since it says "too many messages - suspending error reporting" towards the end.

  • Mathias Mamsch
    Mathias Mamsch
    2003 Posts

    Re: Running DXL script in the background

    ‏2013-12-01T15:25:08Z  
    • Searil
    • ‏2013-11-28T17:16:49Z

    I copied the error messages to below. I can do 2 things. One is first open the gui via command line, do some staff, close again the gui so i learnt that this is "Interactive Batch" or I start the .dxl script via command line always without gui. Actually if you explain more detailly what should i do for remove this error message i will happy because i am very new at this doors and I have to do this task in a little time.

    Remind : The dxl works fine at Gui, but when i try on command line everything is going wrong. I don't understand why it is like that. :/ 

    If you want I can also add the source code. 

    Thanks for helps.

     

    -E- DXL: <utils/doctools/itfutil.inc:25> (AHeading) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:26> (AShortText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:27> (ALongText) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <utils/doctools/itfutil.inc:29> (AName) already declared in this scope
    Included from:
    <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:6> 
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:78> (fontTable) already declared in this scope
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:102> incorrect arguments for (<<)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:187> incorrectly concatenated tokens
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrect arguments for function (richTextFragment)
    Included from:
    <Line:1> 
    -E- DXL: <d:\workset\mc_tool_doors\addins\Devel\exporterRTF.dxl:202> incorrectly concatenated tokens
    Included from:
    <Line:1> 
      too many messages -- suspending error reporting

    You need to know that DOORS is using a different set of include files, when running in batch vs. interactive mode. Whenever you get a bunch of errors about "Symbol is already declared" that means that you quite certainly included the same include file twice. Check your startup.dxl vs. you startupBatch.dxl  in your lib/dxl folder of your client to see the differences in the include file.

    And the solution is normally easy: just comment out the problematic include and you will get rid of those errors.

    However if you want a script to be runnable in both batch and interactive mode, but one include is missing in batch mode but is included in interactive mode (or vice versa), then you need a wrapper script to start the script in batch mode, that contains the relevant includes. E.g.

    #include <utils/doctools/itfutil.inc>
    #include <your program.dxl>

    for batch mode, and for interactive mode you only use <your program.dxl> ... this way you make sure, that in both modes the relevant include is incorporated.

    Also you need to be aware that batch mode programs really run on the highest possible DXL context level. Due to some inconsistencies in the DXL parser this will give you problems, when running programs in batch mode with some code, that will run fine in interactive mode. Forward references and also redeclarations can be a problem here ... The solution for this is normally to wrap the DXL program for batch mode in  { ... } braces, this way the DXL parser will use the same scoping rules like in interactive mode and everything works smoothly.  (as weird as that sounds!)

    In your case my guess is, that both modes (batch and interactive) might include the itfutil.inc but while from interactive mode it is perfectly fine to reinclude itfutil.inc, its not fine for code that runs on top level. So just wrap your DXL program in { } and see if that solves your problem.

    Hope this helps, regards, Mathias

    Updated on 2013-12-01T15:31:22Z at 2013-12-01T15:31:22Z by Mathias Mamsch
  • Searil
    Searil
    7 Posts

    Re: Running DXL script in the background

    ‏2013-12-02T11:27:35Z  

    You need to know that DOORS is using a different set of include files, when running in batch vs. interactive mode. Whenever you get a bunch of errors about "Symbol is already declared" that means that you quite certainly included the same include file twice. Check your startup.dxl vs. you startupBatch.dxl  in your lib/dxl folder of your client to see the differences in the include file.

    And the solution is normally easy: just comment out the problematic include and you will get rid of those errors.

    However if you want a script to be runnable in both batch and interactive mode, but one include is missing in batch mode but is included in interactive mode (or vice versa), then you need a wrapper script to start the script in batch mode, that contains the relevant includes. E.g.

    #include <utils/doctools/itfutil.inc>
    #include <your program.dxl>

    for batch mode, and for interactive mode you only use <your program.dxl> ... this way you make sure, that in both modes the relevant include is incorporated.

    Also you need to be aware that batch mode programs really run on the highest possible DXL context level. Due to some inconsistencies in the DXL parser this will give you problems, when running programs in batch mode with some code, that will run fine in interactive mode. Forward references and also redeclarations can be a problem here ... The solution for this is normally to wrap the DXL program for batch mode in  { ... } braces, this way the DXL parser will use the same scoping rules like in interactive mode and everything works smoothly.  (as weird as that sounds!)

    In your case my guess is, that both modes (batch and interactive) might include the itfutil.inc but while from interactive mode it is perfectly fine to reinclude itfutil.inc, its not fine for code that runs on top level. So just wrap your DXL program in { } and see if that solves your problem.

    Hope this helps, regards, Mathias

    Hello Mathias, thanks for your reply. I wrapped my dxl program with {... } and the error number is decrease but it shows still 40 errors.

    First of all my command line script is this :

    "C:\ProgramFiles\....\doors.exe" -d 3636@pvbd-01 -u "username" -P "password" -b "myprogram.dxl"

    1) myprogram.dxl contain 2 includes

    2) Should I put myprogram.dxl with .inc files in same directory ?

    3) The problem on my side is this dxl files is not written by me. I only try to fix for starting this .dxl from command line.

    So the problem is still continue. Do you explain the solution in different way :/

    Thanks in advance. 

     

  • Mathias Mamsch
    Mathias Mamsch
    2003 Posts

    Re: Running DXL script in the background

    ‏2013-12-10T12:57:17Z  
    • Searil
    • ‏2013-12-02T11:27:35Z

    Hello Mathias, thanks for your reply. I wrapped my dxl program with {... } and the error number is decrease but it shows still 40 errors.

    First of all my command line script is this :

    "C:\ProgramFiles\....\doors.exe" -d 3636@pvbd-01 -u "username" -P "password" -b "myprogram.dxl"

    1) myprogram.dxl contain 2 includes

    2) Should I put myprogram.dxl with .inc files in same directory ?

    3) The problem on my side is this dxl files is not written by me. I only try to fix for starting this .dxl from command line.

    So the problem is still continue. Do you explain the solution in different way :/

    Thanks in advance. 

     

    Did you solve your problem? If not please post an example dxl file that reproduces the error, your command line call and the DOORS version that you are using. Regards, Mathias

  • Searil
    Searil
    7 Posts

    Re: Running DXL script in the background

    ‏2013-12-10T16:11:04Z  

    Did you solve your problem? If not please post an example dxl file that reproduces the error, your command line call and the DOORS version that you are using. Regards, Mathias

    No , I am not. 

    This is the my dxl program : http://paste.ubuntu.com/6509308/

    This is the first include file which in the dxl(on the top) : http://paste.ubuntu.com/6509314/

    This is the second include file which in the dxl(on the top): http://paste.ubuntu.com/6509320/

    This is the third include file which is in the 1103 line : http://paste.ubuntu.com/6551816/

    This is my command line command : "%ProgramFiles%\IBM\Rational\ DOORS\9.3\bin\doors.exe" -d 36@bie01 -u "username" -P don -b "d:\workset\mc_tool_ doors\addins\Devel\ exporterDoc.dxl"

     

    I am trying to figure out why it doesn't work nearly 1 week. I will getting crazy:/ any help is appreciated.

  • Searil
    Searil
    7 Posts

    Re: Running DXL script in the background

    ‏2013-12-10T16:11:09Z  

    Did you solve your problem? If not please post an example dxl file that reproduces the error, your command line call and the DOORS version that you are using. Regards, Mathias

    No , I am not. 

    This is the my dxl program : http://paste.ubuntu.com/6509308/

    This is the first include file which in the dxl(on the top) : http://paste.ubuntu.com/6509314/

    This is the second include file which in the dxl(on the top): http://paste.ubuntu.com/6509320/

    This is the third include file which is in the 1103 line : http://paste.ubuntu.com/6551816/

    This is my command line command : "%ProgramFiles%\IBM\Rational\ DOORS\9.3\bin\doors.exe" -d 36@bie01 -u "username" -P don -b "d:\workset\mc_tool_ doors\addins\Devel\ exporterDoc.dxl"

     

    I am trying to figure out why it doesn't work nearly 1 week. I will getting crazy:/ any help is appreciated.

  • Mathias Mamsch
    Mathias Mamsch
    2003 Posts

    Re: Running DXL script in the background

    ‏2013-12-10T21:47:09Z  
    • Searil
    • ‏2013-12-10T16:11:09Z

    No , I am not. 

    This is the my dxl program : http://paste.ubuntu.com/6509308/

    This is the first include file which in the dxl(on the top) : http://paste.ubuntu.com/6509314/

    This is the second include file which in the dxl(on the top): http://paste.ubuntu.com/6509320/

    This is the third include file which is in the 1103 line : http://paste.ubuntu.com/6551816/

    This is my command line command : "%ProgramFiles%\IBM\Rational\ DOORS\9.3\bin\doors.exe" -d 36@bie01 -u "username" -P don -b "d:\workset\mc_tool_ doors\addins\Devel\ exporterDoc.dxl"

     

    I am trying to figure out why it doesn't work nearly 1 week. I will getting crazy:/ any help is appreciated.

    Sorry for ignoring that post so long. If take your myprogram.dxl replace the two includes at the top by the following lines:

    // Export RTF
    {
    pragma runLim,0
    DB dbExplorer
    #include <standard/help/codes.inc>
    #include <utils/tabUtils.inc>
    #include <utils/openModulesMemoryManagement.inc>

    #include <utils/doctools/itfutil.inc>
    #include <utils/doctools/rtfattr.inc>

    ...

    Then at least the include errors vanish. A "no current module" error appears, however that is to be expected. Can you try this please?

    Regards, Mathias

    P.S.: It is always tricky to get scripts that were designed for the GUI to run in batch mode. Sometimes you need to declare some internal variables (like above: dbExplorer to avoid having to include the whole GUI stack). That will work only of course if no function that actually uses this variable is called.

    Updated on 2013-12-10T21:48:33Z at 2013-12-10T21:48:33Z by Mathias Mamsch