![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Adventures in modifying enumerated types Topic Summary: Created On: 18-Aug-2004 11:27 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I’m currently developing a utility to modify attributes and types across multiple modules. I thought I’d share my findings regarding modifying enumerated attribute types as this area is poorly (and incorrectly) documented in the dxl manual.
It’s possible to make the following changes relatively easily: - Modify the string of any value in the list - Delete an existing value from the end of the list - Add a new value to the end of the list However, it becomes much more complex when deleting or inserting a value at any other point in the list. This seems to be due to the mapping. Say we have 3 values in an enumerated type with associated mapping: Value mapping A 0 B 1 C 2 If we want to insert X between A and B the mapping for the existing values must not change: A 0 X 3 B 1 C 2 This can be achieved once but the problem is that there doesn’t seem to be any way of obtaining the existing mapping and so it would not be possible to modify the type again. When modifying the type, if the mapping was set to 0, 1, 2, 3 all the values in the attribute would change (with no change bars or history). Very dangerous! The edit types dialogue seems to manage this as following any inserting, moving etc, the mapping still seems to be 0, 1, 2, 3, 4. If anyone has a solution to this I’d be very interested! ------------------------- Stuart Gilbey C4 Systems Limited www.c4systems.co.uk |
|
![]() |
|
![]() |
|
You should probably adopt a new strategy featuring creating a whole new attribute, as follows:
- Rename the current attr def to "-old". - Rename the current attr type to "-old" - Read the Enumerations from the Type -old and create a new type based on that info, but inserting as you see fit. Actually, you'd create the new type via arrays in your DXL - Create a new Attr Def. - For every object, copy the -old value to the New. - Delete the -old type and def. Advanced DXL will create the new with History off; but "modify" the attr definition to turn History on after the copy. You won't lose History with this method since last weeks History mods to the attribute will have the same attr name as next week's. - Louie |
|
![]() |
|
![]() |
|
Hi Stuart,
did you complete your maintenance-tool?
i would be very glad if you could publish it to our community
![]() |
|
![]() |
|
![]() |
|
quote: Does "relatively easily" mean "by getting all the values and making a new array one bigger than the previous, and then loading that into the type definition"? As in this topic? The manual doesn't say anything that I can find, but the idea in the other topic is essentially the same as what I came up with. Seems like a long way 'round if it's the only way. Chris |
|
![]() |
|
![]() |
|
Okay... I have been working on this currently. I am working on a script that allows for the maintenance of an ESR or WAD enurated type. I have completed the code for adding to the end of the enumeration or modifying one that currently exists. I am attaching the code if you care. It is ugly, but it works for now. I Will be adding the functioniality of delete and doing some clean up.
As you mentnioned on top of the manual being wrong for this call, there is supposable a function call enureration.string[] that will allow you to get the mapping information. Have not tried it yet, and I received this from the tech support. You willl have to set up a temp array of the right size. It sucks that dxl does not allow dynamic arrays, and will not allow you to pass an array if some of the field are null. Hope this helps anyone that needs it. |
|
![]() |
|
![]() |
|
Hi Leonard
Can you paste the IncludeFiles for this script? |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Adventures in modifying enumerated types
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.