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: update/modify enum values of an attribute type
Topic Summary:
Created On: 11-Dec-2008 14:09
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.
 11-Dec-2008 14:09
User is offline View Users Profile Print this message


Anurag Chukka

Posts: 13
Joined: 6-Sep-2008

hi,

i have an attributetype: "mytemp" (basetype: enum)
it has following values/strings: val1, val2, val3

i want to be able to: add a new value val4, change val2->val2new and delete val3.

i try to use the function modify but i get the follwing error:
cannot edit attribute type: mytemp as the attribute type is in use.


any suggestions.
Report this to a Moderator Report this to a Moderator
 11-Dec-2008 14:54
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

That error means that you have an attribute that is defined by your type.

You have to remove this association before modifing with dxl.

Althought you can modify the type within the GUI.

Modifying an associated type with dxl is not the easiest thing to do. However, if you search the forum there is some discussion about the subject.
Report this to a Moderator Report this to a Moderator
 11-Dec-2008 16:19
User is offline View Users Profile Print this message


Marco Gomes

Posts: 11
Joined: 4-Sep-2007

bool UpdateEnum (Module module_p)
{
string Type_p = TYPE
AttrType at = find(module_p, Type_p)

if ( !null at )
{
string codes[] = { ...., //-
.... }
int values[] = { ...., //-
..... }
int colors[] = { ....., //-
..... }
int mapping[] = { ......, //-
...... }

string err
bool real_color_options_for_types_courant = getRealColorOptionForTypes()
setRealColorOptionForTypes( true )

modify( at, Type_p, codes, values, colors, mapping, err )
setRealColorOptionForTypes( real_color_options_for_types_courant )

if (err !="")
{
"error"
return false
}
}

// save the module
save(module_p)
return true
}
Report this to a Moderator Report this to a Moderator
 11-Dec-2008 17:44
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Notice that the form of function 'modify' above includes the mapping[] array; and this form is not presented in the DXL manual. 'mapping' maps existing enum positions to the newly proposed ones as represented in the other arrays.

Looks like you need to practice to make this 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.