![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Modifying enumerated attributes, project-wide Topic Summary: Created On: 12-Sep-2002 21:56 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
You CAN insert new enumerated values into an in-use enumerated type. My feeble efforts at doing this with DXL failed but you can do it manually. Deleting available values may get tricky or may not be allowed.
- Louie |
|
![]() |
|
![]() |
|
You can do it in DXL if, as Louie says, all you want to do is add items. However it's a bit tricky -- it appears the manual is incomplete and there may be a bug as well.
I'm attaching a little example which works for me. Judith |
|
![]() |
|
![]() |
|
// This script changes the inheritance of all attributes that end with _Compliance or _ComplianceText for
// all modules in the top-level folder of a project. // For setting up a change to enumerations, I would look at the .dxl online manual for the syntax; I remember // that there was a code example showing how to add to an enumeration. // Rob rperkins@caspiannetworks.com string AdNameStr string AdNameStrRt string AdNameStrLt int i AttrDef ad string modName Module m_target for modName in current Project do { m_target =edit (modName, true) print (modName "\n") for ad in m_target do { //print "Attribute: " ad.name "\n" if (ad.name == ("ASIC_Compiance")) { string NewName NewName = ("ASIC_Compliance") ad = modify(ad, setName, NewName) } /*Skip nrinprefix = create put(nrinprefix, 1,1) put(nrinprefix, 2,2) put(nrinprefix, 3,3) put(nrinprefix, 4,4) //Permission all = read|create|modify|delete|control // There are 1 to 5 characters in front of the _Compliance or _Compliance text, so gotta check for all of these for each i in nrinprefix do { */ for i in 0:5 do { AdNameStr= ad.name AdNameStrRt= AdNameStr[i:] //print AdNameStr"\n" if (AdNameStrRt == ("_Compliance")) { ad = modify(ad, setInherit, false) print ("Modified " AdNameStr "\n") } AdNameStr= ad.name AdNameStrRt= AdNameStr[i:] //print AdNameStr "\n" if (AdNameStrRt == ("_ComplianceText")) { ad = modify(ad, setInherit, false) } AdNameStr= ad.name AdNameStrRt= AdNameStr[i:] //print AdNameStr"\n" if (AdNameStrRt == ("_Delivery")) { ad = modify(ad, setInherit, false) print ("Modified " AdNameStr "\n") } /* These functions set access control to be inherited rather than specific. The inheritedVal function does it for the attribute value of the attribute definition ad in module m. string inherited{Def|Val}(Module m, AttrDef ad) */ } //1 to 4 } //ad in module save(m_target) close(m_target) }//modules in proj |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Modifying enumerated attributes, project-wide
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.