Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Communicating with DOORS
Topic Summary: Cummunication with DOORS from other programms
Created On: 26-Feb-2008 22:20
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 26-Feb-2008 22:20
User is offline View Users Profile Print this message


Beniamin Longodor

Posts: 5
Joined: 16-Jan-2008

Hello everybody,

I'm currently looking for the best solution on establishing a connection with DOORS and cummunicating with it from an own written programm (language might be C# or Java). The problem I'm facing is the fact that I can't find any code sample or similiar on how to do such a thing. I've searched the manuals as well as this forum.
So far, I see these solutions:
1. Communicating via OLE
2. Cummunicating via IPC

Running scripts from command line using dxlips ord dxlipf is very limited.

For solution one I've found some example, but not for the second. I've read on this forum that apiSend or apiReceive can't handle more than 2KB. Furthermore, could anyone help me on how to use initDXLServerV2, there seems that the documentation fails on describing it.

As I said before, I'm a still new to IPC communication so it would be nice if anyone could give me more information or even example code on how to use it with DOORS.

Thanks in advance!
Report this to a Moderator Report this to a Moderator
 26-Feb-2008 23:33
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

If you haven't already found it, there is a section in the DXL Reference Manual on "Controlling DOORS from applications that support automation". It's (erroneously) under the "Partitions" section in the 8.1 version, though I think they fixed that in 8.3.

It describes the OLE interface, and provides examples of controlling DOORS via VB macros in Excel. One note, we've been able to use the macro examples via Excel successfully, but had trouble connecting to DOORS with this interface from ASP.net (actually I think it might have been a VBScript inside it, or something along those lines). We have been able to control ClearCase from the same application, so we never did figure out where the problem was.

Don't know anything about the IPC stuff...

Chris
Report this to a Moderator Report this to a Moderator
 27-Feb-2008 14:13
User is offline View Users Profile Print this message


Beniamin Longodor

Posts: 5
Joined: 16-Jan-2008

Thanks for the info, I'll give it a try, and let you know how it works or not...
Allthough I'll still be looking on a solution using IPC, so if anyone knows...

Edited: 29-Feb-2008 at 09:57 by Beniamin Longodor
Report this to a Moderator Report this to a Moderator
 29-Feb-2008 09:58
User is offline View Users Profile Print this message


Beniamin Longodor

Posts: 5
Joined: 16-Jan-2008

As I'm new to OLE as well as to IPC, do you know if there is any possibility to communicate with DOORS over OLE without having Doors to be opened, something like batch mode?
Report this to a Moderator Report this to a Moderator
 29-Feb-2008 12:38
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Search for batch in the DOORS help file.

There are two topics you'll want to look at:

- Running DOORS in batch mode
- Summary of command line switches

That should get you started.

Basically you need to make a command line call with something like:

C:\> doors -b dxl_programs\batch_analysis.dxl -p Car -u "Jill"

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 4-Mar-2008 22:26
User is offline View Users Profile Print this message


Beniamin Longodor

Posts: 5
Joined: 16-Jan-2008

Actually there is not much about batch mode or command line switches in the manuals I searched through.
In fact I know how to use a batch file or a command, but I don't really know how to communicate with the Doors Server (batch mode) through IPC, that's what I'm actually looking for.
Report this to a Moderator Report this to a Moderator
 10-Mar-2008 10:57
User is offline View Users Profile Print this message


Stefan Winkler

Posts: 1
Joined: 6-Mar-2008

Hi,

I worked my way through trial and error during the past few days and I got a working communication between Java and DOORS.

Please correct me, anyone, if you know better than me (which is quite possible).

Some facts, before I go into detail:


  1. I don't know the difference between apiConnectSock and apiConnectSockV2. A notable difference is that after apiConnectSock you can apiSend("print session"); and the script works, while after doing the same apiSend("print session"); after apiConnectSockV2 the server times out, so the server seems to be awaiting further communication from the client in any way
  2. As far as I can tell, there is no way to directly communicate with the DOORS server. You always need a client to do this.
  3. Consequently, what you do need in any case is a DOORS client with an activated DXL server as described by the API manual, Chapter 4.
  4. The documentations of the DOORS DXL IPC functions are a bit confusing. If you read IPC substitute TCP-Connection, and some things get clearer. Also, the client function signature should be documented as IPC client(int port, string hostIP).


So after these initial topics, I'll describe roughly what I'm doing - I want to do as much in my Java project as possible. If you have other requirements, you can adjust the architecture to your needs.

In Java I prepare a server TCP socket in order to directly receive an answer from DOORS. (The other alternatives, like executing a command line and reading STDIN, OLE automation, clipboard communication or temp file creation have been discussed in other threads already, and I don't really like them ...). This server socket is listening in a separate thread.

Then, I prepare a string: a DXL script to be executed. This DXL can send an answer to my Java program by opening an IPC client connection (read: TCP connection) and sending back the information. Here is a hello world example:

String script = "ipc = client(4000, \"127.0.0.1\") \n" +
"send (ipc, \"Hello Java!\") \n" +
"disconnect ipc \n" +
"delete ipc \n");

I then use a simple JNI method to do apiConnectSock, apiSend, etc.
As described above, the answer is sent directly to the Java thread where the server socket is listening. This thread reads and concatenates everything it is sent (so the 2k limitation should not be a problem, if the output is split and sent in smaller bits.).
I didn't go too deep inside the 2k limit, but my first guess would be that it has to do with send and receive buffers of the socket.

After returning from the JNI method, I wait for the receiver thread to finish and read the string it received.

A good way to encapsulate data should be using XML (as described, e.g., L=here]https://forum.telelogic.com/customer/doors/messageview.cfm?catid=17&threadid=9012[/L]).

In the attached ZIP is my complete hello world program including the Java and C++ code. I hope this does help some of you.

BTW, I also tried communicating with the DOORS DXL server directly from Java by opening a TCP socket and writing DXL to it. However, the server reports that it fails to get an acknowlege reply from the client and stops without sending anything back. So there is some kind of additional protocol on top, so I think there is no way other than using the C API for the initial communication.

Maybe there would be a way to write a custom TCP DXL server which could be connected directly from Java using the batch code in chapter 4. But I am not sure about that.

Regards,
Stefan Winkler

DOORS-Java.zip
DOORS-Java.zip  (63 KB)

Report this to a Moderator Report this to a Moderator
 19-Mar-2008 19:27
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Stefan,
Thanks for the Java lesson - this may be useful to me. I think the end of the message has to be marked if its a long rtf string. I have something like the following - think it was swiped from someone else - but forget who - apologies to the author! Now how to stream the output to WORD and convert into word xml! An interesting project and something I probably don't have time to do. Its also something that DocExpress should do - sorry to go off topic. You should apply for a job on the docexpress team!

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 5-Apr-2008 00:11
User is offline View Users Profile Print this message


Beniamin Longodor

Posts: 5
Joined: 16-Jan-2008

Thanks a lot Stefen, you code example helped me a lot.

I've yet a problem when trying to start the DXL server from batch-mode:
I can send something to DOORS but trying to receive a message from DOORS, I get the following exception:

Does anyone have any solution for this or a workaround?

Edited: 5-Apr-2008 at 00:13 by Beniamin Longodor
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.