![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Sending DOORS commands Topic Summary: Created On: 21-Sep-2004 21:46 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Never communicated with DOORS before. I need to invoke DOORS if it isn't running, and then send it a command, presumably in the form of DXL to execute.
I can use the -dxl command line switch in an icon to run the DXL, but it opens a new instance of DOORS ever time. I'd rather just send DOORS the DXL to run. - Louie |
|
![]() |
|
![]() |
|
Have a look at runing DOORS in batch mode in the online hep.
Regards Ken McGuffie |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
Don't know squat about VB but have had some accidental luck with MS-Word macros. I Defined an MS-Word macro:
Sub testDoors() Set DOORSObj = CreateObject("DOORS.Application") DOORSObj.runFile ("c:\doors-stuff\DXL-Local\Curr-DXL\HyperlinkToObj.dxl") End Sub and ran it manually and it works, so long as DOORS is already running. Thanks. Two questions: [1] instead of "runFile" is there a "runCommand" command that will allow me to use the following parameter: "string ID = "ABC_12"; $include <c:\yaddy\My.dxl>"? [2] With VB, can I query to see if DOORS is already running? If not then invoke it and wait until it IS running, the proceed with the above functions. [3] Once I get this VB subroutine the way I want, how would I invoke it from Internet or Windows explorer (rather than manually from MS-Word), and make it seem like we are Hyperlinking to the DOORS object? - Louie |
|
![]() |
|
![]() |
|
here's some VBA which looks for an instance of DOORS...
Dim appDoors As DoorsDXL Private Function connectToDOORS() As Boolean On Error GoTo connectHandler Dim sErrMsg As String Set appDoors = CreateObject("DOORS.Application") connectToDOORS = True Exit Function connectHandler: sErrMsg = "Unable to communicate with DOORS. DOORS has not been started" MsgBox prompt:=sErrMsg, Buttons:=vbCritical connectToDOORS = False End Function have a look at www.msdn.microsoft.com for examples of CreateObject and GetObject there can only ever be one instance of this object and this is registered in the table of running objects in windows. Running DOORS for the first time creates this entry in the table. Running DOORS for a second time replaces this with a new instance. runStr() is what you need for running a snippet of dxl. Have a look in the DXL reference help for definitions of this function and the automation interface. {DOORSHOME}/bin/doorsdxl.tlb is the COM type library for this interface. because this is a COM automation interface you can use VBScript, JavaScript, or anything else which implements the windows scripting interfaces. Script, of course, can be embedded in html, but VBScript is not the same as VBA. "windows 2000 scripting guide" from Microsoft Press is a good book to look at for scripting. This is a very crude COM interface. If you wanted anything more sophisticated you might need to use the DXL API (dxlapi.dll) and create your own COM interface - which would allow you to do some more interesting things with explorer, I.E, or VB. Have a look at the example "C" code in {DOORSHOME}/api. |
|
![]() |
|
![]() |
|
I managed to make Ron's snipette work after deleting the sendKeys line, but I had to run it from MS-Word VB editor since I'm ignorant about these things. I cannot get your's to run at all, its complaining about a "type" error in your first "DIM" line (no doubt the "DoorsDXL" reference).
Anyway I'm too ignorant even to ask the right questions. Sounds like you're saying this function gets deployed somewhere on the Client machine, and then my invoked function makes use of this table entry? I'm trying to find a VBA gury here, and I'll give him these posts and hope he can figure it out. - Louie |
|
![]() |
|
![]() |
|
To run a vb script from a file use a text editor to generate the code and save with a .vbs extension
The classic helloWorld.vbs results from pasting into a file the following: MsgBox "Hello World" |
|
![]() |
|
![]() |
|
To run a vb script from a file use a text editor to generate the code and save with a .vbs extension
The classic helloWorld.vbs results from pasting into a file the following: MsgBox "Hello World" |
|
![]() |
|
![]() |
|
Got MsgBox "Hello World" to work in a .vbs file as you suggested. Cannot get:
Sub testDoors() Set DOORSObj = CreateObject("DOORS.Application") DOORSObj.runFile ("c:\doors-stuff\DXL-Local\Curr-DXL\HyperlinkToObj.dxl") End Sub to work. It doesn't seem to do anything. Also, is there some way to get the above COMMANDS to work without actually saving it as a file? That is, put these commands in some sort of link that we can put on a Web Page? Perhaps I haven't made clear the extent of my VB ignorance... ![]() - Louie |
|
![]() |
|
![]() |
|
Louie,
Try this in a Macro. The fIsAppRunning function checks to see if DOORS is already opened. The connectToDOORS opens DOORS if it is not already opened. There is also some HTML code that runs the connectToDOORS function. Edited: 24-Sep-2004 at 22:43 by Dale Reed |
|
![]() |
|
![]() |
|
Got the following to work.
Set DOORSObj = CreateObject("DOORS.Application") DOORSObj.runFile ("c:\doors-stuff\DXL-Local\Curr-DXL\HyperlinkToObj.dxl") Also got .runStr to work. But could get "GetObject" to work. Also, simple commands like Dim DOORSObj as Object generate VBA errors (expecting end of statement at char 14). I don't think VBA is installed "correctly" if at all on this computer. What I need is: if (Doors isn't running) MsgBox("Start DOORS manually right now, then hit OK") Set DOORSObj = GetObj("DOORS.Application") if (didn't get DOORSObj) MsgBox("DOORS not running") else to the runStr stuff. - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Sending DOORS commands
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.