![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Attribute DXL automatically set to null
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.