![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 } |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.