scriptingibm-doors

How to make all requirements start with the requirement ID (in brackets), in IBM Rational DOORS?


I have 3 attributes:

  1. ID
  2. Text
  3. Is Requirement?

Here's an example of what I want:

Before:

ID      Text                              Is Requirement?
AB45    3.1.2 Apples                      FALSE
AB46    All apples shall be red.          TRUE

After:

ID      Text                              Is Requirement?
AB45    3.1.2 Apples                      FALSE
AB46    [AB46] All apples shall be red.   TRUE

Is there a programmatic way to add ID's to the front of the "Text", only if "Is Requirement?" is TRUE? If so, where exactly would the code go and how would you execute it? Would it be an additional DXL attribute?


Solution

  • Not directly. An attribute can either be calculated or manually filled, not both at the same time. Perhaps you might want to have two views, one "Edit view", one "Show Requirements View". In the latter, you will not show the main column (main column shows "Object Heading" and "Object Text"), but you will have a DXL Layout column with a code like this:

    bool objIsReq = obj."Is Requirement?"
    if (objIsReq) {
      display "[" identifier(obj) "] " obj."Object Text" ""
    } else {
      if (!null obj."Object Heading""") then display number (obj) " - " obj."Object Heading"""
      if (!null obj."Object Text""") then display obj."Object Text"""
    }