2

I want to access DOORS content using python. I have read this answer , but it did not give clear instructions.

Hazem Abaza
  • 331
  • 4
  • 21

1 Answers1

3

The general information you can get from the link is: "there is no direct way to get information about DOORS content using Python". The only reliable way to get information from DOORS is by writing and starting a DXL script.

You might want to start this DXL script from "outside", e.g. using Python and after it is finished you can get the result from that script. This post sums it up quite well: Rational Doors 9.6 interfacing with C# (C# is interchangeable with any other language here).

Your python program will possibly contain something like

import subprocess
subprocess.call([r'C:\Program Files\ibm\Rational\DOORS\9.6\bin\doors.exe', '-dxl', r'C:\Users\Hazem\Desktop\DOORSScript\Doors2xml.dxl', '-user', 'Hazem', '-password',  'test'])

While your DXL file might create e.g. an .XML or .CSV file at a predefined location and then your script will read the content of this file and do whatever you want to do with it (you could also catch the script's STDOUT, but that ususally brings more problems).

You can pass parameters to a DXL script using environment variables, in DXL there is a perm string getenv (string var) to get these.

Mike
  • 2,098
  • 1
  • 11
  • 18
  • Is there anyway where I can read from DOORS db without exporting in .XML or CSV ? – Hazem Abaza Mar 05 '20 at 14:38
  • 1
    using temporary files for exchanging data between two programs has proven to be the most stable way. Of course you can use any other format to store your data. Interprocess communication is an alternative (after all, that's what the link you posted is about), but that's basically the same as capturing STDOUT/STDERR. And as soon as you handle large amounts of data or complex data structures, IPC might get it's own problems. – Mike Mar 05 '20 at 14:45
  • Hi @Mike, does your recommended method (using an external DXL script) work with DOORs Next Generation? – HyperionX Feb 17 '22 at 02:47
  • Doors and doors next are completely different programs. Doors next does not understand dxl. There are several ways to create Doors next extensions, see e.g. https://jazz.net/library/article/87230 – Mike Feb 18 '22 at 07:08
  • The -dxl argument is for passing script content. To pass a dxl file (and avoid opening the GUI) use -batch. – linux_pangolin May 18 '23 at 15:13