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: Getting link information from an object
Topic Summary:
Created On: 8-Mar-2006 15:50
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.
 9-Mar-2006 00:53
User is offline View Users Profile Print this message


Paul Ransley

Posts: 10
Joined: 20-Sep-2004

Hi Mark

Whats the problem with out links? Just getting the attribute values? Out links works as per your code, for in links try using LinkRef to ensure modules are open first. See the attached code for an example of LinkRef and use of probeAttr_ to extract object and module attribute values, and alternative methods rem'd out. The attached file is has your code with a couple of changes to list the outlink targets module prefix, abs number, module name, and object text.

You mentioned trying to get the module Prefix value, if you want the Object Identifer value just use the function identifier(o) as in the sample, its simplier than building it up from module prefix and absolute number values. This sample code is a simple bit of text hacked from layout dxl produced by the Wizard, note that it doesnt handle errors with links etc, as the code in your post, or baselines but does show LinkRef and probeAttr for module attribute values.


> 1) Do you need to have the target modules open

To get just the Absolute Number with out links, no, just use targetAbsNo(Link l) in the "for l in o" loop. Yes to get at all attributes. Yes for in links and use the function LinkRef first to get a handle on the module that the link goes to and use that to open the module. Create some layout DXL using the Wizard using the options "open" modules and "all" modules and see the differences, note where the target\source modules are opened (read(module). Trying running the layout DXL wizard for in/out links and compare, choosing some module and object attributes. Setup a view with incoming links, and use "Manage open modules" to in Project Explorer to see that the target module is open. Edit the layout dxl to remove\rem out the lines to open the module if object is null (about line 23/24). Refresh view, with target module still closed nothing is displayed. Manually open the target module and the column is populated.


> 2) What does probeAttr_() do?

probeAttr_ and probeRichAttr_ are undocumented functions, they return a string, extracting module or object attribute information, see attached code for examples, do a search in this forum for further info and possible errors, but in summary;

string = probeAttr_(Object or Module, string Attribute)
string = probeRichAttr_(Object or Module, string Attribute,true\false)

Its reported that probing is better than using something like s = othero."Absolute Number" or otherMod."Prefix". Other references to the function refer to getting values for object attributes but it works for module attributes as well (see lib\dxl\utils\attrutil.inc). For module name and description can also use s = name(otherMod) or s = description(otherMod) as in rem'd out lines in sample code.

> Is there a trick in this forum to get new lines, etc?

You might find it easier to put code into the code box offered in the edit/reply window, see the reply button at the bottom of posts rather than quick reply, or "Attach Code" option in new post.

> otherMod... was not able to extract the prefix from another module (only from the current module)

Sounds like otherMod is not set to the "other" Module. Add a bit od dxl to help debug, try checking if otherMod."Name" equals the "source" module or not, if it is, ensure you get a handle on the other module.




-------------------------
Paul Ransley<BR><BR>Beaver Computer Consultants Limited

Edited: 9-Mar-2006 at 04:44 by Paul Ransley
Report this to a Moderator Report this to a Moderator
 10-Mar-2006 17:20
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes. For scripts that work on the module used to invoke them, you should routinely do something like this:
Module mCurr = current
if (null mCurr){infoBox("Run from open module."); halt}
...
Sometimes you need to "current = mCurr" within the code, for functions that presume the current module such as find(attribute name).

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