IBM Doors DXL: Layout DXL where the traceability wizard fails

Problem

In some cases you will run into trouble when you want to use the standard function of Doors to create a traceability for a depth of 2 that is not going into the same direction. To solve this problem the implementation of an own Layout DXL is necessary.

The example below shows the situation with depth 2 and the same Linkmodule in which you can use the standard function to create a Layout DXL column:

Linkmodule 1
Linkmodule 1
A
A
Linkmodule 1
Linkmodule 1
B
B
C
C

The next situation, which is not possible to master with the standard doors function, shows the problem where depth two with two different direction and link module types gives the needed traceability information for the report.

Linkmodule 1
Linkmodule 1
A
A
B
B
C
C
Linkmodule 2
Linkmodule 2
Object in source module
Object in source module
Outgoing link of type „Linkmodule 1“ (i.e. „Creates“)
[Not supported by viewer]
Incominglink of type „Linkmodule 2 (i.e. „Triggers“)
[Not supported by viewer]
not possible withoud Standard Traceability Wizard
not possible withoud Standard Traceability Wizard

Approach – Ansatz

To get the needed traceability information within a module, you can add a layout dxl column by clicking on the column header of the current selected view in the module and add a layout DXL column. This layout DXL column can iterate through the outgoing modules of the current object, catch all objects that are linked and look for incoming links on it.

Solution – Lösung

//
/*******************************************************************************
* Author: Björn Karpenstein 
* Stakeholder: Björn Karpenstein
*
* Subversion
* ===================================================
* $Rev::               $:  Revision of last commit
* $Author::            $:  Author of last commit
* $Date::              $:  Date of last commit
*
* Change Control
* ==============
* n/a
*
* Description
* ===========
* This script gives the traceability over 2 modules with two different diection
* and module types
*******************************************************************************/
string firstLinkModule  = "/Product Lifecycle Management/10 Administration/Create";
string secondLinkModule = "/Product Lifecycle Management/10 Administration/Triggers";

Skip dublettenRaus=createString;

pragma encoding,"UTF-8";
pragma runLim, 0;

//Object obj=current;
 
Link lnk;
Link inLnk;
LinkRef lnkRef;
ModName_ otherMod = null;
 
for lnk in obj->firstLinkModule do
{
	string tmn=fullName target(lnk);
	
	if(!open module tmn)
	{
		read(tmn,false);
	}
	
	Object keypoint = target(lnk);
	//display identifier(keypoint) "\n";
	
	if(null keypoint)
	{
		 //display "no link to keypoint";
	}
	else
	{	     
		//display "keypoint : " identifier(keypoint) "";
		for lnkRef in keypoint<-secondLinkModule do
		{
		  //display "drin";
		  otherMod = module (sourceVersion lnkRef);
		  if (!null otherMod) 
		  {
		    if ((!isDeleted otherMod) && (null data(sourceVersion lnkRef))) 
		    {
		      load((sourceVersion lnkRef),false);
		    }
		  }
		}
		     
		for inLnk in keypoint<-secondLinkModule do
		{
		  // Get In-Link Object
		  Object phase = source inLnk;
		  if ( isDeleted(phase) || null(phase) ) continue;
		     
		  string dummy="";
		  if(!find(dublettenRaus, phase."Object Text" "", dummy))
		  {
			  put(dublettenRaus, phase."Object Text" "", phase."Object Text" "");
		  }
		}
	}
}

int phaseCounter=0;

// Iteration through the SkipList
for myIterator in dublettenRaus do
{
	string keyValue = (string key(dublettenRaus));
	string currentObject = null;
	
	if(find(dublettenRaus, keyValue, currentObject))
	{
	   display keyValue;
	}
}

delete dublettenRaus;