IBM Support

How to create a DXL attribute using a DXL script?

Question & Answer


Question

How to create a DXL attribute using a DXL script?

Answer

You can achieve this by using one of the following methods. As a precaution, p lease try these steps on a test module before implementing them in production to ensure proper functioning in your particular configuration.

M ethod 1

string dxlname = "specify the code here"
AttrDef ad = create object type "Text" attribute "attribute name" dxl (dxlname)
Note: Remember to escape double quotes and backslashes in the string. Also, you must remember to insert newlines or semicolons in the code in order to separate the expressions.

Alternatively if you want to have the code in include file then you can use the following steps.

Method 2

AttrDef ad = create object type "Text" attribute "attribute name" dxl "#include <path to DXL file>"

For example:

**********************************************************
string mydxl="
pragma runLim, 0;
Buffer bsz = create;
void endAttributeDXL() {
    if (!null obj && attrDXLName != \"\")
    {
        obj.attrDXLName = richText tempStringOf(bsz);
    }
    delete bsz;
}
void display(string s) {
    bsz += s;
    bsz += \"\n\";
}
void displayRich(string s)
{
    bsz += s;
    bsz += \"\n\";
}
display \"Hello\";
endAttributeDXL();"
AttrDef ad = create object type "Text" attribute "Test" dxl (mydxl)  
**********************************************************************
This example would create a DXL Attribute "Test" of Type Text with the DXL code that is specified in mydxl string.
 

DISCLAIMER: Any assistance that Telelogic gives in issues regarding private DXL scripting and/or modified DOORS scripts are not covered under the Telelogic - Licensee maintenance/support agreement. All suggestions Telelogic provides should be tested on either a test server or a back-up database, and never in a production environment. Telelogic shall not be responsible for loss of data or down time through the interaction with these unsupported scripts. Telelogic's assistance is provided "AS IS," and TELELOGIC HEREBY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ALL IMPLIED WARRANTIES OF SATISFACTORY QUALITY, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. IN NO EVENT SHALL TELELOGIC BE LIABLE FOR ANY DAMAGES OR CONSEQUENCES ARISING FROM ITS ASSISTANCE EVEN IF TELELOGIC IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7.1, 8.0, 8.1, 8.2, 8.3 3036229 AnswerProduct versionPartner ContentInternal ContentCategoryReference IDAuthor

[{"Product":{"code":"SSKR2T","label":"IBM Engineering Requirements Management DOORS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

11271

Document Information

Modified date:
01 May 2020

UID

swg21324138