Pinned topic Invoke DOORS from external Application with OLE Automation
to pass back status information from DOORS, I want to invoke DOORS from an external application by using Visual Basic code and the OLE automation interface. Thus, I can access status information from DOORS by taking into account the "Result"-Property.
e.g. Set DOORSObj = CreateObject("DOORS.Application")
DOORSObj.Result = "Just checking"
My question is:
How can I pass command line switch parameter/values to the DOORS Application OLE Automation Object?
Is there a way to state the values for switches such as "-data", "-user", "-cli" or "-batch" etc...?
Thanks in advance, Helko
Re: Invoke DOORS from external Application with OLE Automation2011-11-28T11:34:19ZThis is the accepted answer. This is the accepted answer.Hi Helko,
remember that OLE Server in DOORS means, that you already started DOORS, i.e. you can only access an already running instance of DOORS using OLE. Therefore your commandline parameters depend on whoever started DOORS. Unfortunately you cannot select which DOORS instance to use as OLE server using the CreateObject syntax from VB that means, you will always get the DOORS instance that you started first. So if that instance is not started on the right server -> screwed.
Therefore batch provides the easier way of selecting exactly the connection and environment that you want to use. If you still want to use OLE and still want to define your connection and environment you would a) need to make sure, that no DOORS instance is already started b) start DOORS from the commandline explicitly passing the connection and environment parameters that you need c) wait until DOORS has started up (see post below) d) start your dxl script over COM.
See that post for details on how to start up DOORS before accessing over COM:
Hope that helps, regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Helko 270002HGD938 Posts
Re: Invoke DOORS from external Application with OLE Automation2011-11-28T12:07:06ZThis is the accepted answer. This is the accepted answer.
- Mathias Mamsch 2700025PVX
using OLE Automation is out of solution scope now. Running my very special user restricted DXL program needs to start up a new and fresh instance of the DOORS client.
As you said before, OLE each time returns the first started instance or starts up a new instance, if no one is already running, but command line switch parameters are not supported. That behavior is too risky and doesn't cover the needs of my use case.
Thus, I have to switch back to the DOORS running batch client solution where I have to exchange status feedback values via temporary files.
Re: Invoke DOORS from external Application with OLE Automation2014-04-14T12:22:30ZThis is the accepted answer. This is the accepted answer.
Any news regarding this topic? Is any possibility to get the handlers for two different DOORS instances?
The problem I have with the running DOORS in batch mode is that it takes too much time for opening and authentication each time
I am running a script. What I want to do, is to run different scripts for different users and maintain the opened DOORS instance for a specific user.
Re: Invoke DOORS from external Application with OLE Automation2014-04-17T08:19:23ZThis is the accepted answer. This is the accepted answer.
- DanyO 2700072U0W
I guess the most common way for your use case is to use a DXL server ,,, I started an open source project called "Drive DOORS" once, which already contains a functional DXL server ... If you want I can spend some more time on it to get it to a more stable state but since the feedback from the DXL community to any open source activities was 0 so I did go forward with it.
Maybe you find something that can help you: https://github.com/domoran/DriveDOORS
llandale 270001QM9N3005 Posts
Re: Invoke DOORS from external Application with OLE Automation2014-04-17T14:46:57ZThis is the accepted answer. This is the accepted answer.
- DanyO 2700072U0W
I think there is a way to dump all active processes on your client PC to a text file (using a cmd.exe command line), then parse the text file to find all the "doors.exe" instances, then you could figure out which one to get the process number for, then open an OLE connection to that process. That is well beyond me.
 You want to manually log into DOORS presumably as yourself. Then somewhere on your client PC (such as some web page) send DXL scripts to the open DOORS but run them under someone elses DOORS account? Cannot do that, the doors.exe will remained logged in to the original user.
 Perhaps you want to use your client PC as a psuedo server, where other client PCs send doors.exe on your client scripts to run; presumably via some IPC socket. I have no idea how to do that.
I note your batch approach has the significant disadvantage of having to hard code doors account user names and passwords out on your intra-net.
Re: Invoke DOORS from external Application with OLE Automation2014-04-18T06:34:53ZThis is the accepted answer. This is the accepted answer.
- Mathias Mamsch 2700025PVX
Thank you for your response. Your propose could be a solution for my need.
For the moment I have developed a .Net server which gets requests and processes them using the DOORS in batch mode for each client.
Assuming that we can have around 30 different users, with different access rights, in the same time, do you think your solution could deserve them? This means to have 30 DOORS servers running in the same time?
Re: Invoke DOORS from external Application with OLE Automation2014-04-18T07:43:15ZThis is the accepted answer. This is the accepted answer.
- llandale 270001QM9N
Yes, I already get DOORS running application, but when using DOORS API, it is using the first instance, as it was discussed at the beginning of this topic.
In our company we have DOORS client installed on some machines, which runs Window server, each DOORS users needs to log on the terminal server and use DOORS from its user session. What we want to do is to provide to the users an interface to access DOORS from their own computers. For this we have implemented a .Net server which runs on the terminal servers. This server takes requests from the client applications. We have implemented a protocol for reading DOORS projects, modules, attributes, objects...etc. The problem is on the server side, to reduce the response time to the client. Also we want to ensure that each action is done under the DOORS user account. It would be simple if we could have a generic DOORS user and have a DOORS instance opened, but this is not possible.
During testing, I saw that the running of a dxl script is not time consuming, but opening and log on to the DOORS, usually on out sistems, takes around 10 seconds.
Thank you for your reply, I am opened to any suggestion.
mcnairk 270001TJW2111 Posts
Re: Invoke DOORS from external Application with OLE Automation2014-04-22T14:17:34ZThis is the accepted answer. This is the accepted answer.
- DanyO 2700072U0W
Well I guess the answer to your question dependes on the use case. If you need 30 users to execute DXL scripts from remote using their own user accounts in DOORS, then of course you need 30 DXL Servers (which means 30 DOORS clients) running the script of each user.
However with DriveDOORS my ideas went into a different direction. I think in practice on a server application the focus is on running trusted scripts in which case with proper programming a lot of times scripts can be run with an elevated account, not with the credentials of the user itself.
For some scripts of course (especially when data manipulation is involved), it can be necessary to invoke a script with user credentials. The question would therefore be, what kind scripts are we talking for the 30 users? Could it be an option to restrict access to the script in the server backend, but run the script with elevated credentials?
For the Design of DriveDOORS:
DriveDOORS was indended as a DXL Server for Server Applications, e.g. in the backend of a web server or similar. The core of DriveDOORS (which is almost finished) was to enable a low latency robust DOORS connection, that allows to execute DXL scripts over a network and pass inputs and outputs of the DXL scripts over the network efficiently. The interface is pretty easy, it should be something like:
- start a DXL Server
- execute a script on a DXL server
- get output of a script
- stop the DXL Server
- (maybe later receive progress messages from a DXL script)
As a second layer Drive DOORS should implement something like a DXL Web Service. Special DXL scripts that have input parameters and output results. For a couple of other programming languages like Java, Python, etc. I wanted to provide an API that allows to execute those functions on the DXL Server and retrieve the results. To receive the best performance I did not use a normal web server for this, but a low level socket connection for communication.
This interface can then be used from a (web) server backend which implements additional functionalities like security, user management, connection management.
However I never got down to finishing these two layers due to time restrictions and a lack of interest from others. So If you are interested I would be happy to start working on that again. Regards, Mathias