![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: easier way to update a enumerated type in use Topic Summary: Help! need to update an type used in 500+ modules Created On: 5-Jan-2006 19:35 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||||||
I have a standard attribute in 500 + modules and have to add a new value to the attribute enumerated type. Rather than opening each module manually and adding the value by hand, has anybody come up with an easier way to do this with a script?
e.g. Test Level type, need to add to add value "Vehicles" to the enumerated type. Attribute: Test Level I was thinking of doing this: 1) loop through all modules 2) check if attribute type and attribute using that type exists 3) copy the attribute values to a temporary text attribute 3a) save all the existing enumerated values of the attribute type into a dynamic array 3b) append the new value "Vehicles" to the dynamic array 4) delete the existing attribute and its type (i think in that order) 5) recreate the attribute type with the appended value, recreate the attribute 6) copy the temporary text attribute values to the new attribute. 7) removing the temporary attribute. |
|||||||
![]() |
|||||||
![]() |
|||||||
Janet,
I've already made a stab at doing what you're aiming at. The utility I've started (it's not yet complete, and I haven't looked at it for months) assumes the names of the attribute type and attribute, but presents a dialogue box to the user to enter a new enumeration for the type. The value is automatically generated, but the name is manually entered, and a colour can be associated (that bit's a bit clunky). The new enumeration can also be 'based on' an existing enumeration, which means for any object in the module that has the attribute containing the base enumeration, the new enumeration will be added. If the attribute doesn't include the base enumeration, it won't include the new enumeration. Did that make sense? I hope so! The code is attached, and that is, after all, the ultimate documentation... The main problem with the approach I've taken is that if someone has a module open, you won't get the access you need and that module won't be updated. This either means you have to run the utility at a 'quiet time' or go round and clean up afterwards. I think the utility leaves enough of a trail to know when it's failed in a module -- if not, you can surely add one... I'd considered the possibility of creating a trigger that checks the state of a module against a master list when it's closed, and keeping itself up to date, but I'm frankly scared of triggers, so I've avoided the issue! Another problem is that if someone else has updated the attribute type somewhere other than the module you run the utility from, you'll lose their changes. I think you can get around this by (a) not allowing anyone else access to change the attribute type definition, and (b) keeping a 'master' module, that contains just the definitions (and maybe some documentation), from which you run the utility. Let us all know how you get on! Paul. PS Got a bit of a problem attaching the files ![]()
------------------------- Paul dot Tiplady at TRW dot com TRW Automotive Edited: 9-Jan-2006 at 08:33 by Paul Tiplady |
|||||||
![]() |
|||||||
![]() |
|||||||
Alternatively, you might be able to use the runAll2.dxl script posted on this thread
|
|||||||
![]() |
|||||||
![]() |
|||||||
Paul - I'll take a look at your scripts, do you have the utils.inc file referenced in your script?
Thanks Janet |
|||||||
![]() |
|||||||
![]() |
|||||||
Janet,
Sorry, must have slipped my mind. Should be attached to the original (to keep it all in one place). Paul. ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|||||||
![]() |
|||||||
![]() |
|||||||
Hi Janet,
please refer to my post Modify Enum Type Values There is an easier way of handling that problem ![]() Hope, that helps, greetings Reik Schröder ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||
![]() |
Telelogic DOORS
» DXL Exchange
»
easier way to update a enumerated type in use
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.