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: Sending DOORS commands
Topic Summary:
Created On: 21-Sep-2004 21:46
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.
 21-Sep-2004 21:46
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 22-Sep-2004 07:43
User is offline View Users Profile Print this message


Ken Mcguffie

Posts: 63
Joined: 3-Feb-2004

Have a look at runing DOORS in batch mode in the online hep.

Regards

Ken McGuffie
Report this to a Moderator Report this to a Moderator
 22-Sep-2004 15:58
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Using basic script or visual basic you can do something like the following:


Sub testDoors()
    Set DOORSObj = CreateObject("DOORS.Application")
    SendKeys "John Smith" & "{TAB}" & "password" &    "{ENTER}", True
    DOORSObj.runFile ("c:\doors\lib\dxl\example\ddbintro.dxl")
End Sub
Report this to a Moderator Report this to a Moderator
 22-Sep-2004 16:55
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 23-Sep-2004 09:46
User is offline View Users Profile Print this message


Ross Morgan

Posts: 74
Joined: 15-Apr-2004

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.
Report this to a Moderator Report this to a Moderator
 23-Sep-2004 16:29
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 23-Sep-2004 17:57
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

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"

Report this to a Moderator Report this to a Moderator
 23-Sep-2004 17:57
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

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"

Report this to a Moderator Report this to a Moderator
 24-Sep-2004 16:43
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 24-Sep-2004 22:40
User is offline View Users Profile Print this message


Dale Reed

Posts: 11
Joined: 13-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 27-Sep-2004 19:44
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
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.