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: Attribute DXL automatically set to null
Topic Summary: Is it possible to have attribute DXL not change the attribute value?
Created On: 8-Jun-2006 16: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.
 8-Jun-2006 16:06
User is offline View Users Profile Print this message


Daryl Walters

Posts: 11
Joined: 13-Nov-2002


Forgive me if this is a basic question, but is there a way to prevent attribute DXL from changing the value of the attribute. For instance, consider the simple DXL attribute code:

bool isTrue = obj."Some attribute"
if( isTrue )
{
obj.attrDXLName = "Set the value"
}

All I want is to have the attribute not change when isTrue is false, but it seems DOORS will set this to null automatically.

Is there a way to suppress DOORS nulling out the value? I could use a dummy attribute to hold the value, but that just seems clunky.

- Thanks
Report this to a Moderator Report this to a Moderator
 8-Jun-2006 16:57
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Daryl,

it seems, that you want to mix a "normal" attribute with an attribute DXL.
AFAIK that is not possible, so the value of ADXL is always determined by the code. There is no setable value. If the code does not set any value, it leaves empty.
Tip : You never should leave ADXL result empty, because then it will be calculated again on next access!

The way, you have supposed in your message, could be the best one. Define another attribute (not ADXL), wich contain your fallback value and modify your ADXL to use this fallback value if isTrue is false.

Greetings
Reik Schröder

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 12-Jun-2006 14:27
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I initially thought this was easy, by doing the following:

string s = obj.attrDXLName ""

if (isTrue)
{
obj.attrDXLName = "new value"
}
else
{
obj.attrDXLName = s
}

Not so! Do not try this at home.
Attempting to read the value of a DXL attribute from within the attribute crashes DOORS.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 13-Jun-2006 00:43
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Try this:
string CurrentValue, DesiredValue
CurrentValue = obj.attrDXLName ""
bool isTrue = obj."Some attribute"
if (isTrue)
DesiredValue = "Set the Value"
else DesiredValue = CurrentValue

// If you keep the value null it will repeatedly recalculate, slowing down scrolling etc.
if (null DesiredValue) DesiredValue = " "

obj.attrDXLName = DesiredValue
Report this to a Moderator Report this to a Moderator
 16-Jun-2006 16:02
User is offline View Users Profile Print this message


Daryl Walters

Posts: 11
Joined: 13-Nov-2002


Unfortunately, as Tony mentioned above you cannot do this. It blows up DOORS (no self-referential Strange-Loopiness allowed). It would be nice though if you could call some function to turn off the resetting of the attribute if the DXL does not explicitly change the value.

I guess what I should do is set up a trigger to recalculate this value, but it just doesn't seem as elegant. I'll have to set the trigger on some event that may not be exactly what I really want.

Thanks,

-Daryl
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.