Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 1-Aug-2008 14:06
User is offline View Users Profile Print this message


sudarshan agnihotri

Posts: 2
Joined: 11-Oct-2006

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
Report this to a Moderator Report this to a Moderator
 1-Aug-2008 14:13
User is offline View Users Profile Print this message


Tony Goodman

Posts: 97
Joined: 6-May-2008

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
Report this to a Moderator Report this to a Moderator
 1-Aug-2008 14:53
User is offline View Users Profile Print this message


sudarshan agnihotri

Posts: 2
Joined: 11-Oct-2006

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.