receive null for current

508 views
Skip to first unread message

soma

unread,
Apr 13, 2006, 11:22:15 AM4/13/06
to Telelogic DOORS DXL
I've got a strange problem with current values.
e.g.

Module m = current
Object o = current m

or simply the short form

Object o = current

who both should deliver the current object of the current module
work fine when invoked from within a module (Tools->Edit DXL).
The same thing done from within the Doors Database window
(also: Tools->Edit DXL) or via a COM client object
(JScript on Windows scripting host):

var oDoors = new ActiveXObject('DOORS.Application');
oDoors.runStr("Module m = current\nObject o = current m");

leads to

-R-E- DXL: <Line:2> null Module parameter was passed into argument
position 1
-I- DXL: execution halted

Any ideas??

TIA,

Robert

demoivre

unread,
Apr 13, 2006, 12:32:58 PM4/13/06
to Telelogic DOORS DXL
Hi Robert,

I think the problem you are running into, if I understand you
correctly, is because
the "Current" operation determines what the currently selected object
(or module) is
and assigns your variable to it. If you run DXL from the main window,
there is not a selected
module (nor object for that matter), so current returns null.

To run a script from the main window, you need to select the module and
object within that
module via other means. There are a variety of ways to get a handle on
a module you are interested
in (loop through the project to find the module of interest, etc). It
depends on what you are trying to do
as to which method is the best.

Hopefully I am correctly addressing your concern.

Doug

Raymond Durbin

unread,
Apr 13, 2006, 1:43:16 PM4/13/06
to Telelogic DOORS DXL, dbet...@hotmail.com
I think that you are right Doug.  If I remember correctly, setting the current module will by default select the first object in that module, assuming it is populated.
 
Ray

>>> dbet...@hotmail.com 4/13/2006 11:32 AM >>>

soma

unread,
Apr 18, 2006, 8:59:19 AM4/18/06
to Telelogic DOORS DXL
Hello Doug,

as there can be a selected module - e.g. the module last focussed -
there should be a current module available, at least if there exists a
last opened module window.
When I tried the code there allways was a last opened module as I
wanted to see the results from my code exactly there.
It is possible to find the current module for a Doors client, as there
is an application that does exactly this (Matlab/Simulink, Toolbox
'Verification and validation' since the current updated version). But
as the code is not delivered with that product I can't look it up
there. It may also be done via the Doors C-API and is possibly not
feasible via dxl.
Anyway, thanks for your efforts,

Robert

Paul

unread,
Apr 18, 2006, 9:44:30 AM4/18/06
to Telelogic DOORS DXL
Robert,

The undocumented 'getSelectedItem()' function returns the Item that is
currently selected in the main 'DOORS Explorer' window. Is that any
help?

Paul

unread,
Apr 18, 2006, 9:44:31 AM4/18/06
to Telelogic DOORS DXL

soma

unread,
Apr 19, 2006, 4:08:27 AM4/19/06
to Telelogic DOORS DXL
> The undocumented 'getSelectedItem()' function returns the Item that is
> currently selected in the main 'DOORS Explorer' window. Is that any
> help?
Thanks Paul; to look for some undocumented function for that job is a
good hint,
though this one itself is not exactly what I need.
It's as follows: An application offers you to export some stuff to
Doors. It tells you to
make the Doors-Object where you want to place that export the last
thing focussed
in Doors, then return to that application and finally trigger the
export. The last selected
item in the 'DOORS Database'-Window may but needs not necessarily lead
to the
Module-Window last focussed.
Anyway, I'll try to find some more hints on undocumented functions for
my purposes.
Thanks,

Robert

Reply all
Reply to author
Forward
0 new messages