How to select DOORS attribute by reference attribute : DXL Script

Question!

I have database of doors requirements in a module. There are 2 attribute for each requirement. When I select first attribute value as A, then second attribute value 1 should automatically get updated with that reference.

Similarly for B -> 2, C -> 3

Using a DXL script, how do I get this functionality?



Answers

You need to make attribute 2 a DXL attribute with the following code:

string attr1 = "NAME_OF_ATTRIBUTE_1"
string attr2 = "NAME_OF_ATTRIBUTE_2"

if(obj.attr1 "" == "A") {
    obj.attr2 = 1
} else if(obj.attr1 "" == "B") {
    obj.attr2 = 2
} else if(obj.attr1 "" == "C") {
    obj.attr2 = 3
}

Good luck, Steve



This video can help you solving your question :)
By: admin