![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Selecting from multi valued attribute Topic Summary: I have created a dxl layout attribute and I want it to get information from a attribute which has multi values. Created On: 1-Aug-2008 14:06 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have created a dxl layout attribute and I want it to get information from a attribute which has multi values like R1, R2, R3. It can pick only when the value is single like R1 or R2 but ignores the object when it has values like R1, R2, R3. The following dxl picks the value when the object has single R1 in Release Allocation but ignores the object if it has R1, R2, R3. I want it to pick if it find R1 whereever it finds.
/* This attribute DXL was generated on 31/07/2008 14:28:46. */ // prevent dxl timeout dialog pragma runLim, 0 Buffer bsz = create void endAttributeDXL() { if (!null obj && attrDXLName != "") { obj.attrDXLName = richText tempStringOf(bsz) } delete bsz } void display(string s) { bsz += s bsz += "\n" } void displayRich(string s) { bsz += s bsz += "\n" } //********** // DXL generated by DOORS traceability wizard on 31 July 2008. // Wizard version 2.0, DOORS version 8.1.0.8 pragma runLim, 0 void showIn(Object o, int depth) { Link l LinkRef lr ModName_ otherMod = null Module linkMod = null ModuleVersion otherVersion = null Object othero string disp = null string s = null string plain, plainDisp int plainTextLen int count bool doneOne = false Item linkModItem = itemFromID("47b4240065e31c9b-00000261") if (null linkModItem) { display("<<Link module not found>>") } else if (type(linkModItem) != "Link") { display("<<Invalid link module index for this database>>") } else { string linkModName = fullName(linkModItem) for lr in all(o<-linkModName) do { otherMod = module (sourceVersion lr) if (!null otherMod) { if ((!isDeleted otherMod) && (null data(sourceVersion lr))) { load((sourceVersion lr),false) } } } for l in all(o<-linkModName) do { otherVersion = sourceVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) continue othero = source l if (null othero) { load(otherVersion,false) } othero = source l if (null othero) continue if (isDeleted othero) continue if(othero."Release Allocation" "" != "R1") continue doneOne = true if (depth == 1) { s = name(otherMod) if (isBaseline(otherVersion)) { s = s " [" versionString(otherVersion) "]" } displayRich "{\\b Module: "s"}" s = probeRichAttr_(othero,"Release Allocation", false) displayRich "{\\b Release: "s"}" s = (identifier othero) displayRich "{\\b Parent ID: "s"}" s = probeRichAttr_(othero,"Object Text", false) displayRich "{\\b Requirements: "s"}" "\n" } } } } showIn(obj,1) //********** endAttributeDXL() Any help or advice will be appreciated. Sudarshan |
|
![]() |
|
![]() |
|
To check for a particular value in a multi-valued enumeration, you use the isMember perm.
bool isMember(AttrDef ad, string s) In your example, replace if(othero."Release Allocation" "" != "R1") continue with if (!isMember(othero."Release Allocation", "R1")) continue ------------------------- Tony Goodman Smart DXL limited www.smartdxl.com |
|
![]() |
|
![]() |
|
Hi Tony,
Thanks for your quick response. But when I use isMember perm it comes up with an error message -R-E- DXL: <Line:76> expected multi valued attribute Backtrace: <Line:94> -I- DXL: execution halted -R-E- DXL: <Line:76> expected multi valued attribute Backtrace: <Line:94> -I- DXL: execution halted May be because these values are not enumerated but entered manually. See example below Release R1 R1, R2, R3 R1 R2 R1, R2 R1, R3 R1 R2 Regards Sudarshan |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Selecting from multi valued attribute
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.