How do I make a DOORS DXL attribute based on the value of another attribute?

StackOverflow https://stackoverflow.com/questions/23526024

  •  17-07-2023
  •  | 
  •  

سؤال

X and Requirement are existing attributes.

I want to create an attribute Z such that, for the given object, if Requirement=True, then Z={the value of attribute X}, but if Requirement=False, then Z={Object Heading and Object Text}.

What is the DXL for making this attribute? Thanks.

هل كانت مفيدة؟

المحلول

This is untested code but try something like this: (assuming attribute z exists as text)

Module m = current
Object o


for o in m do
{
   if ((o."Requirement") == "true")
   {
       o."z" = o."x" ""
   }
   else   // requirement = false
   {
       o."z" = o."Object Heading" "\n" o."Object Text" ""

   }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top