There's been a few times now that I've wanted to use Python to analyze content within the IBM Rational DOORS database. So I started searching. To my excitement I found this article but after trying to view the examples and finding out they're dead links it was back to square one.
After reading the DOORS Api Manual I was able to finally figure things out. Before we continue, you'll need the following batchserver.dxl file saved on your local machine:
Here's the basic overview of how to connect to DOORS using Python:
Startup DOORS using the batch mode and run the script above:
Create a Socket Connection to the batch server and send a dxl command:
It's actually pretty simple from there. You can pass in custom DXL scripts via the python socket connection. If you want to pass data back from the DXL socket server to Python, you'll need to use the return_ command in the DXL. Here's an example: