Copy absolute number from a baselined module to another module

Hello all,

I have a problem that our customer wants to have changes on a release which is baselined 1 year ago. Now I have to get a copy of this baselined version and have to adapt the links to this baselined version.

Now I come to my problem...when I create a copy out of the baseline, Doors will create new IDs (Absolute numbers). With this mismatch it is impossible to adapt the links.
What I am now thinking of is to copy the absolute numbers from the baselined version to the copied version. But I am lacking of dxl knowledge.
This is the code so far. As I said now I do not have the knowledge to transfer the id to an self created attribute of the copied module. At the moment the current module is the baselined module.
Maybe there is someone who can help me?
Thank you.


Object o Module m = current 
//baselined version string source string target   string path = 
"pathtotargetmodule" Module mod = read(path)     

for o in m 

do 
{ source = o.
"Absolute Number" 
"\n" print 
"s:" source   

for o in mod 

do 
{ print o.
"AbsNo" 
}   
}

Chi-tin - Thu Dec 16 04:51:03 EST 2010

Re: Copy absolute number from a baselined module to another module
Chi-tin - Thu Dec 16 05:11:53 EST 2010

ups...sorry I thought I was still in the DXL forum.

Maybe can an Administrator move this thread to the DXL forum?

Thank you

Re: Copy absolute number from a baselined module to another module
OurGuest - Thu Dec 16 13:19:29 EST 2010

One approach to the problem that does not use dxl is outlined as follows:
First, use spreadsheet export of the Absolute Numbers using Standard view from the Baseline.

Then within excel, rename the Absolute Numbers column to an alternate name such as 'ORIGINAL_ID'.

Then, create a new column named Absolute Numbers in the spreadsheet file.

Then Auto Number the new Absolute Numbers column to match the new ids of the new formal module.

Import the spreadsheet as a CSV file, back into the New Module (created from the Baseline).

Re: Copy absolute number from a baselined module to another module
Chi-tin - Fri Dec 17 05:48:33 EST 2010

Hi again,

I found on my own via using a dxl script.
Thank you for the reply, I think will consider this for the next time :)

Here is the code in case someone is struggled with this issue.

pragma runLim, 0 Object os, ot AttrDef ad Item it = item 
"/Training Area/target_modulename"   Module ms = current 
// source module Module mt = module it 
//target module   

for os in ms 

do 
{ 

for ot in mt 

do 
{ 

if (number(os) == number(ot)) 
{ 

for ad in ms 

do 
{ string attrname = ad.name 

if (attrname ==
"Absolute Number") 
{ 

if (ad.object) 
{ string strs = os.attrname ot.
"AbsNo" = strs 
} 
} 
} 
} 
} 
}

Re: Copy absolute number from a baselined module to another module
llandale - Wed Dec 22 16:29:47 EST 2010

Chi-tin - Fri Dec 17 05:48:33 EST 2010
Hi again,

I found on my own via using a dxl script.
Thank you for the reply, I think will consider this for the next time :)

Here is the code in case someone is struggled with this issue.


pragma runLim, 0 Object os, ot AttrDef ad Item it = item 
"/Training Area/target_modulename"   Module ms = current 
// source module Module mt = module it 
//target module   

for os in ms 

do 
{ 

for ot in mt 

do 
{ 

if (number(os) == number(ot)) 
{ 

for ad in ms 

do 
{ string attrname = ad.name 

if (attrname ==
"Absolute Number") 
{ 

if (ad.object) 
{ string strs = os.attrname ot.
"AbsNo" = strs 
} 
} 
} 
} 
} 
}

This example you should not waste time loopiung through attributes, just use the 'find': ad = find(mt, "Absolute Number"). But wait, you don't even need to do that. You seem to presume that the hierarchy of your source and target modules are identical, so you can do this:

if (number(os) == number(ot))
{ ot."AbsNo" = os."Absolute Number" ""
break // no need to keep looking for new "ot" objects
}

Before all that I'd be tempted to make sure both modules have the exact same view, so load the 'Standard View' when opening the modules.

In your original example, you have embedded loops using the exact same loop contol variable, that surely cannot work.

  • Louie