Tag Archive: dxl

Interfacing with DOORS using Python Socket

For as long as I’ve been doing DXL development, I’ve desired ways to interface DOORS with languages besides DXL.  This desire was rooted in my prior experience with writing automation scripts for Rational ClearQuest.  Though quirky, I had found CQ very easy to automate using COM.  Rational DOORS, on the other hand (owing most likely to its Telelogic origins) provides very little in the way of COM automation or any other interface besides DXL for automation.  It is my opinion that this design decision is a legacy form of lock-in for the DXL language (and associated consulting charges).  The COM automation for DOORS is limited to launching DOORS, sending it DXL code, hoping that the code succeeds, and then possibly receiving some string output.  (Note that the opposite is true when DOORS is the client; automating other COM components is reliable, if tedious).

In addition to this simple COM server capability, DOORS also provides a similar socket server.  It still requires automating DOORS using a fair amount of DXL code. If we accept that we are going to have to muck around with DXL code, possibly dedicating it towards providing an API that is driven by code written in another language over the socket, we can still manage to get a lot of work done.  The usage of such a system seemed obscure to me at first (the documentation didn’t help a ton), but it was actually pretty easy to create a simple socket server in DXL and a socket client in Python.  This is is where Python really shines.

Here is the DXL socket server code.  This code can be executed in the DXL interactive editor.  It will lock up the client GUI while the code loops waiting for connections.  Connecting clients can then send arbitrary DXL code or the keywords “quit_” (to disconnect) or “shutdown_” (to shutdown the DXL socket server).

Here is the Python socket client code.  First, to shutdown the DXL socket server, run the client script like “python IPC_Client.py —shutdown”.  This will unblock the DOORS GUI.  Otherwise, run the script without any arguments and the three print_* functions will send DXL code to the socket server and then print the returned results.


I am a DOORS DXL developer

I am a DOORS DXL developer.  Never heard of it?  Well join the club!  DOORS is a IBM Rational product, previously sold by Telelogic.  DXL is the proprietary C-like scripting language used to customize DOORS.  Since 2008, I have been working as a full time DXL developer.  Sometimes I also get to mix in some Python code, which is a major joy compared to DXL.  DXL has some major drawbacks, all of them ultimately linked to its proprietary nature.  The usage domain is limited to DOORS and DOORS integration.  The community surrounding DXL is dedicated and professional, but small.  As a result, there is sparse public domain DXL code and almost no library code.  Furthermore, much of the language functionality is undocumented and obscure.  Never-the-less, I have become something of a DXL export the last couple of years.  I was lucky enough to have the timing of learning DXL and C++ at the same time.  As a result, I have been able to channel some of what I have learned at school into my DXL work.  In future posts to this blog I am going to try to share some of what I have learned in the hopes that other DXL developers will be able to benefit form my experience!