DOORS Attribute

IBM DOORS Attribute

In this article we will discuss IBM DOORS attribute.

In IBM DOORS, an attribute is a piece of information that is associated with a requirement or other item in a project. Attributes can be used to capture a wide range of information about requirements, including their status, priority, owner, and description.

Attributes are defined by the project team and can be customized to meet the specific needs of the project. For example, a project team working on a medical device might define attributes to capture information about regulatory compliance, while a team working on a software project might define attributes to capture information about code complexity or testing requirements.

Attributes can be used to filter and sort requirements, making it easier to find and manage specific items in a project. They can also be used to generate reports and to track project progress against specific metrics.

Here is an example of DOORS Attribute –

DOORS Attribute

In DOORS, attributes are often associated with a particular module, which is a container for a set of related requirements. The attributes for a module can be defined independently of other modules in the project, allowing the project team to tailor the attributes to the needs of each module.

Attribute List

The following program lists the attribute in current module –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: attr1.dxl
* $DESCRIPTION: DXL Attribute operation
*
* NOTICE: Copyright www.TheCloudStrap.Com. All rights reserved.
* Software comes without any warranties and guarantees, is provided 
* as is and is not supported. Use this software at your own risk. 
* Authors resume no liabilities.
* 
* Contact: admin {at} TheCloudStrap.com
************************************************************************/

// DXL Attribute operation

Module m = current
AttrDef atrDef

//print list of attribute and attribute type in current module
for atrDef in m do { 
	print atrDef.name " is of type " atrDef.typeName "\n"
}

print "Done!"

The output shows the list of the attributes and type of the attribute.

DOORS DXL Attribute

Create DOORS Attribute

Here is an example code to demonstrate how to create an attribute in DOORS (make sure the DOORS module is opened in exclusive edit mode before running this script) –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: attr2.dxl
* $DESCRIPTION: DXL Attribute operation - create attribute
*
* NOTICE: Copyright www.TheCloudStrap.Com. All rights reserved.
* Software comes without any warranties and guarantees, is provided 
* as is and is not supported. Use this software at your own risk. 
* Authors resume no liabilities.
* 
* Contact: admin {at} TheCloudStrap.com
************************************************************************/

// DXL Attribute operation - create attribute

Module m = current
AttrDef ad

// create attribute
ad = create object type "Real" history true	//-
	 changeBars true date true inherit false //-
	 multi false attribute "Build_ID" (default "0.1") // default value should be a string

// print using attribute record
print "Attr name = " ad.name "\n"
print "Attr Type = " ad.typeName "\n"
print "Object Level Attr? = " ad.object "\n"
print "Object Module Attr? = " ad.module "\n"
print "Inherit? = " ad.inherit "\n"
print "Default value = " (string ad.defval) "\n"
print "History? = " ad.nohistory "\n"
print "Multi-values Attr? = " ad.multi "\n"


print "Done!"

The output window shows that the ‘Build_ID’ attribute was created successfully.

Modify DOORS Attribute

DXL allows us to modify the existing attributes. In the following example, we will modify the name of an existing attribute (make sure the DOORS module is opened in exclusive edit mode before running this script) –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: attr3.dxl
* $DESCRIPTION: DXL Attribute operation - modify attribute
*
* NOTICE: Copyright www.TheCloudStrap.Com. All rights reserved.
* Software comes without any warranties and guarantees, is provided 
* as is and is not supported. Use this software at your own risk. 
* Authors resume no liabilities.
* 
* Contact: admin {at} TheCloudStrap.com
************************************************************************/

// DXL Attribute operation - modify attribute
// make sure the module is in exclusive-edit mode

Module m = current
AttrDef ad

// create attribute
ad = create object type "Real" history true	//-
	 changeBars true date true inherit false //-
	 multi false attribute "Build_ID2" (default "1.5") // default value should be a string

// print using attribute record
print "Print after creating attribute definition: \n"
print "Attr name = " ad.name "\n"
print "History? = " ad.nohistory "\n"


// now modify the attribute
ad = modify (ad, setName, "Build_ID3")
ad = modify (ad, setHistory, false)


// print using attribute record
print "Print after modifying attribute definition: \n"
print "Attr name = " ad.name "\n"
print "History? = " ad.nohistory "\n"

print "Done!"

Here is the output window –

Delete Attribute

The delete() function can be used to delete an attribute. Here is an example (make sure the DOORS module is opened in exclusive edit mode before running this script) –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: attr4.dxl
* $DESCRIPTION: DXL Attribute operation - delete attribute
*
* NOTICE: Copyright www.TheCloudStrap.Com. All rights reserved.
* Software comes without any warranties and guarantees, is provided 
* as is and is not supported. Use this software at your own risk. 
* Authors resume no liabilities.
* 
* Contact: admin {at} TheCloudStrap.com
************************************************************************/

// DXL Attribute operation - delete attribute
// make sure the module is in exclusive-edit mode

Module m = current
AttrDef ad

// find the attribute (to be deleted) in the module
ad = find (m, "Build_ID3")	// 'Build_ID3' was created by the previous dxl script 

if (null ad) { 
	print "Attribute 'Build_ID3' was not found in current module! \n"
	halt
}
else {
	// Delete the attribute record
	delete (m, ad)	// delete attribute "Build_ID3" 
}

// now make sure the attribute record was deleted
AttrDef ad1 = find (m, "Build_ID3")
if (null ad1) {
	print "'Build_ID3' attribute record has been deleted !\n"
}
else {
	print "Deletion of 'Build_ID3' attribute record has failed !\n"
}

print "Done!"

As shown in the output window, the ‘Build_ID3’ is now deleted using the above dxl script.

Conclusion

In this article, we have discussed DOORS Attributes. We have explained how to list all attributes, create new attribute, modify an existing attribute, delete an attribute etc. However, if you have any questions about DOORS Attribute, please feel free to comment below.

DOORS Attribute
Scroll to top
error: Content is protected !!