DOORS DXL Module Operation

DOORS DXL Module Operation

This article describes the DOORS DXL module operations and example programs for creating and managing DOORS modules using DXL. 

Create Module in DXL

DXL allows us to create a new module using create() function. Here is an example code snippet –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: m1.dxl
* $DESCRIPTION: DXL Module example
*
* 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
************************************************************************/

// Example of Module
Module m1 = null
Module m2 = null

// Creating Formal Module and Link Module
m1 = create("Sample1", "sample Formal Module description", "dxl", 1500, true) // Absolute number i.e. 1500 must be greater than 0
m2 = create("sampleLink1", "sample Link Module description", manyToMany, false)
close(m2)
print "Done!"

Here is the output –

Delete Module in DXL

The softDelete() function can be used to delete a module in DXL. Here is another example code snippet –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: m2.dxl
* $DESCRIPTION: DXL Module example
*
* 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
************************************************************************/

// Example of Module
Module m1 = null
Module m2 = null

// Creating Formal Module and Link Module
// m1 = create("Sample1", "sample Formal Module description", "dxl", 1500, true)
// m2 = create("sampleLink1", "sample Link Module description", manyToMany, false)
// close(m2)
// print "Done!"

// Now delete the Module
softDelete module("Sample1")
if (isDeleted module "Sample1") {
	print "Module 'Sample1' has now softDeleted!\n"
	undelete module ("Sample1")
	
	if (isDeleted module "Sample1") {
		print "Module 'undelete' operation was not successful!\n"
	}
	else { 
		print "Module 'Sample1' has now un-deleted!\n"
	}
}
print "Done!"

Here is the output –

Module – Open and Close

In the following example code snippet, we will see how to open a module in DXL –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: m3.dxl
* $DESCRIPTION: DXL Module example
*
* 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
************************************************************************/

// Example of Module
Module m = null
current = folder("/DOORS_Training/Sample/Training")

// open module in edit mode
print "Open Module in exclusive edit mode.\n"
m = edit("Sample1", true)  // Display is set to true

print "Saving module.."
save(m)  	// save the module

print "Closing module..."
close(m)  	// close module
print "Done!"

Here is the output –

In this example, we have opened the module in exclusive edit mode with the edit() function and then closed it.

Module Status

DXL provides various built-in functions to provide the module status –

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: m4.dxl
* $DESCRIPTION: DXL Module example
*
* 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
************************************************************************/

// Example of Module
Module m = null
current = folder("/DOORS_Training/Sample/Training")

print "Open Module in Read mode.\n"
m = read("Sample1", true)  
print "Check if module is in Read mode = " isRead(m) "\n\n"

print "Open Module in Edit mode.\n"
m = edit("Sample1", true)  
print "Check if module is in Edit mode = " isEdit(m) "\n"

print "Open Module in Share mode.\n"
m = share("Sample1", true)  
print "Check if module is in Share mode = " isShare(m) "\n"


print "Saving module..\n"
save(m)  	// save the module

print "Closing module...\n"
close(m)  	// close module
print "Done!"

Here is the output –

In the above example, we have shown how to check the read or edit status of a given module using dxl functions.

Module Attribute Access

The following example explains how to access module attributes

// www.TheCloudStrap.Com 

/************************************************************************
* $FILENAME: m5.dxl
* $DESCRIPTION: DXL Module example
*
* 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
************************************************************************/

// Example of Module
Module m = null
current = folder("/DOORS_Training/Sample/Training")

// open module in read mode
print "Open Module in exclusive read mode.\n"
m = read("Sample1", true)  // Display is set to true

string modName = m."Name"
string modDesc = m."Description"

print "Module Name = " modName "\n"
print "Module Description = " modDesc "\n"


print "Done!"

Here is the output –

Conclusion

In this article, we have discussed DOORS DXL Module Operation i.e. – how to create a module, delete a module, and handle different operations using DXL.

DOORS DXL Module Operation
Scroll to top
error: Content is protected !!