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: Creating an Attribute that exists for both module and object
Topic Summary: Can create attributes that exist at either but not both
Created On: 22-Aug-2005 15:47
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.
Answer This question was answered by Louie Landale, on Monday, August 22, 2005 7:27 PM

Answer:
Try the following in your open module:
current = mod
noError()
create(module object type "Text" history false changeBars true attribute "TestAttr1")
string ErrMess = lastError()
if (!null ErrMess) print ErrMess

If the attr already exists this, oddly, won't generate an error, even if the attr is of type String. So you may want to preceed this with an "exists" command.

- Louie
 22-Aug-2005 15:47
User is offline View Users Profile Print this message


James Seal

Posts: 2
Joined: 11-Jul-2005

I have a fair bit of experience with creating and setting up attributes through DXL code for either a Module or an Object, but can't seem to find how to create a new attribute that exists for both Module & Object level.  It's easy to do through the standard DOORS menu, so probably is through DXL as well, but I've had no luck with documentation or experimentation.
Report this to a Moderator Report this to a Moderator
 22-Aug-2005 18:45
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer Answer
Try the following in your open module:
current = mod
noError()
create(module object type "Text" history false changeBars true attribute "TestAttr1")
string ErrMess = lastError()
if (!null ErrMess) print ErrMess

If the attr already exists this, oddly, won't generate an error, even if the attr is of type String. So you may want to preceed this with an "exists" command.

- Louie
Report this to a Moderator Report this to a Moderator
 22-Aug-2005 19:26
User is offline View Users Profile Print this message


James Seal

Posts: 2
Joined: 11-Jul-2005

Thanks.  This does it. I thought I had tried everything with having both Module and Object in the create statement including using &, and, &&, etc. but apparently I just never tried listing them both inline like your example.  As much as I keep learning about DXL, it still keeps getting me with things like this!

Out of curiosity, did you find this in some documentation somewhere or just by trial and error.  The whole section on attribute creation only has examples of either Module or Object with no mention of how to do both (at least that's all I found).
Report this to a Moderator Report this to a Moderator
 22-Aug-2005 22:44
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The syntax in the manual incorrectly suggests exclusive-or. Its possible it was correct in v4 manual but I'm also sure I've seen samples of actual code. And even if I hadn't I'm a monkey-at-the-typewriter kind of guy and would have eventually tried the syntax that worked. And even if I wasn't a monkey-at-the-typewriter guy I've seen so many errors in the manual that I would never suggest that it WAS correct, especially after it didn't work.

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