Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: copying attribute values between modules
Topic Summary:
Created On: 12-Feb-2003 14:03
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 12-Feb-2003 14:03
User is offline View Users Profile Print this message


Mary Miller

Posts: 36
Joined: 12-Sep-2002

Hello,

I was wondering if there is a way to copy attribute values between modules so that I can use those values when linking by attribute. I have not had too much success so far.

I do know that importing an attribute certainly does not copy the attribute values.

Thanks,

Mary
Report this to a Moderator Report this to a Moderator
 12-Feb-2003 15:27
User is offline View Users Profile Print this message


Andrew Tagg

Posts: 29
Joined: 19-Sep-2002

Hi Mary,

One way to do this (not sure if there are more efficient ways) is to export the attribute values to spreadsheet from one module, then Import from spreadsheet to the other module.

The problem is that you need something common between both modules to use as 'Key' data (such as the absolute number) so that doors can match up the attributes to objects on the re-import.

This can be done using the standard Doors 'Export to Spreadsheet' option.

Example:

Export to .csv from Formal Module 1 : Absolute Number, Attribute value.

Import to Formal Module from .csv : Absolute Number, Attribute value.
(select Absolute Number as key during import).


- Andrew.

-------------------------
Andrew Tagg
Astrium EADS
Requirements Management Team
Stevenage
United Kingdom
andrew.tagg@astrium.eads.net
www.astrium.eads.net
Report this to a Moderator Report this to a Moderator
 12-Feb-2003 19:20
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Are you asking: For a given current object, can I set the current value of attr "A" to the value one of my linked partners Attrs values "B"? That is, set the value of attr "OutAbsNo" to the AbsNo of a out-linked object?

Tagg's idea of using the "AbsNo" as the key is only valid when one of your modules was originally some sort of copy of the other; perhaps one is a "restored" version (at the subcontractor's DB) of the "archived" master (at the Prime's DB).

Yes, you can do that but it requires a rather extensive DXL program to administer it. You've got to do such things as insuring you are using the correct link module, and handle the case when there are two outlinked objects. Once you match up the objects (which is the very hard part), the code is trivial: oCurr."A" = oOther."B"; possibly using richText commands if its a Text attr.

- Louie
Report this to a Moderator Report this to a Moderator
 14-Feb-2003 20:51
User is offline View Users Profile Print this message


Mary Miller

Posts: 36
Joined: 12-Sep-2002

Hello,

Okay. Thanks guys. I was afraid that I was going to get those answers. Looks like there is no really simple way to get around this. That is okay, though.

Thanks,

Mary
Report this to a Moderator Report this to a Moderator
 21-Feb-2003 14:22
User is offline View Users Profile Print this message


Mark Phillips

Posts: 40
Joined: 17-Dec-2002

Mary,

Are you wanting to copy the attribute value between modules that are "copies" (i.e. where the object ID is the same in both cases)? If so, the the following should work for you.

This is a sniplet of code from a DXL that I wrote to do basically the same thing.

Let me know if you ment something else (or something is confusing).

Mark

-------------------------
Mark Phillips
mark.phillips@swri.org
Report this to a Moderator Report this to a Moderator
 21-Feb-2003 14:22
User is offline View Users Profile Print this message


Richard Kilgore

Posts: 12
Joined: 16-Sep-2002

Mary -
Please expand your question in great detail. I may be able to help.
It's very simple to copy attribute values between modules. The hard part is determining which values will go where in the second module (on what basis/criteria).

rkilgore@northropgrumman.com
Report this to a Moderator Report this to a Moderator
 3-Mar-2003 18:11
User is offline View Users Profile Print this message


Deniz Akkor

Posts: 18
Joined: 26-Feb-2003

Mark,

How do you modify your code if the modules are not exact copies, i.e. how do you copy an attribute from one module to another which both modules have a common Requirement ID attribute?

Deniz
Report this to a Moderator Report this to a Moderator
 3-Mar-2003 22:13
User is offline View Users Profile Print this message


Mark Phillips

Posts: 40
Joined: 17-Dec-2002



<< Mark,

How do you modify your code if the modules are not exact copies, i.e. how do you copy an attribute from one module to another which both modules have a common Requirement ID attribute?

Deniz
>>



Deniz,

The lines:
nTarget = oTarget."Absolute Number" and
nSource = oSource."Absolute Number"

could just have been formed similar to

nTarget = oTarget."Some Other Attribute" and
nSource = oSource."Yet Another Attribute"

(with nTarget and nSource defined appropriately). The comparison would still work, but the values of those attributes must be EXACTLY the same.

Notice that you don't have to use the same attribute names in both modules.

Some notes about this script:

  • I would not try this comparison with text and string fields, as an extra space at one end or the other will throw things off. Obviously, you could also perform some more complicated logic to deterimine if the vaules were equal, but that was beyond the scope of the question.

  • This script does not REQUIRE unique matching. It will copy the value of oSource.atr over the top of oTarget.art for all matches, so be careful what you use as the comparison.

  • The script can be modified to copy from/to different attribute names by making atrSource and atrTarget definations and changing the oTarget.atr = oSource.atr "" line to oTarget.atrTarget = oSource.atrSource "".

  • The script can also be modified to a/pre-pend to the original text.

  • The script requires some modification to copy non-text attributes.


Hope this helps,

Mark




-------------------------
Mark Phillips
mark.phillips@swri.org
Report this to a Moderator Report this to a Moderator
 4-Mar-2003 22:47
User is offline View Users Profile Print this message


Nandan Banodkar

Posts: 22
Joined: 1-Oct-2002

Hi Mark,

One question, I was trying to understand the why the "continue" was used:

if (!new) continue // don't process if you have already found a match

Or was it rather a 'break'?





-------------------------

Nandan Banodkar

(nandanbanodkar@hotmail.com)
Report this to a Moderator Report this to a Moderator
 5-Mar-2003 19:38
User is offline View Users Profile Print this message


Deniz Akkor

Posts: 18
Joined: 26-Feb-2003

Mark,

Thank you very much for the code you sent me for "copying attribute values between modules". Now, I have another question if you do not mind. I am trying to create a view which will display all of the columns in the current module and also all of the the attributes in the linked module to the current module. I know, I can display the linked attributes of the link module with the traceability analysis dxl code in the DOORS library. However, I need to display also the unlinked attributes of the link module. I could not find any library function in DOORS to do this. Can you help me with this?

Thank you in advance

Den
Report this to a Moderator Report this to a Moderator
 5-Mar-2003 22:44
User is offline View Users Profile Print this message


Mark Phillips

Posts: 40
Joined: 17-Dec-2002



<< Hi Mark,

One question, I was trying to understand the why the "continue" was used:

if (!new) continue // don't process if you have already found a match

Or was it rather a 'break'?
>>



Nandan,

I make no excuses... I am new to DXL programming and did not know about the break function. Thanks for pointing it out.

Mark

PS If anybody is wanting this function to copy to multiple objects, the contine/break line should be removed.

PPS For unique matches (i.e. for the origional question), a Skip list can significantly reduce the total amount of time required to run this script. Search the DXL manual for "skip list example program" to see how it can be done.

-------------------------
Mark Phillips
mark.phillips@swri.org
Report this to a Moderator Report this to a Moderator
 5-Mar-2003 22:48
User is offline View Users Profile Print this message


Mark Phillips

Posts: 40
Joined: 17-Dec-2002



<< Mark,

Thank you very much for the code you sent me for "copying attribute values between modules". Now, I have another question if you do not mind. I am trying to create a view which will display all of the columns in the current module and also all of the the attributes in the linked module to the current module. I know, I can display the linked attributes of the link module with the traceability analysis dxl code in the DOORS library. However, I need to display also the unlinked attributes of the link module. I could not find any library function in DOORS to do this. Can you help me with this?

Thank you in advance

Den
>>



Den,

I am not sure that I understand your question. I think you are trying to access link attributes... which can be done through DXL. Here is an example script from the DXL class.

Mark



-------------------------
Mark Phillips
mark.phillips@swri.org
Report this to a Moderator Report this to a Moderator
 7-Mar-2003 15:12
User is offline View Users Profile Print this message


Deniz Akkor

Posts: 18
Joined: 26-Feb-2003

Mark,

In order to bring some clarification my question, let me give you an example. Say, I have two formal modules A an B. A 3rd link module, C links these formal modules. The A and B have the following attributes, A1, A2, A3, A4 and B1, B2, B3 and B4. A1 and A2 are linked to B1 and B2 respectively through the link module C.

I want to create a view in A module, which will show A1, A2, B3 and B4 in four separate columns. I can show A1(B1), A2(B2) by using the trace library scrip, which came with DOORS. However, I need a script to include B3 and B4 non-linked attributes in two different column in a view of an A formal module. Do you have any suggestion?

Den

Report this to a Moderator Report this to a Moderator
 7-Mar-2003 17:59
User is offline View Users Profile Print this message


Deniz Akkor

Posts: 18
Joined: 26-Feb-2003

Mark,

I already figured out myself how to display those attributes B3, B4. I just added the link module location name in the following statement.

for lr in obj <- "Link Module Location Name"

Thank you

Den
Report this to a Moderator Report this to a Moderator
 7-Mar-2003 21:07
User is offline View Users Profile Print this message


John Segelbacher

Posts: 1
Joined: 20-Nov-2002

I have a layout dxl script that for a given object in a source module (obj),
will display the value of an attribute of the linked object in the target module,
and can also assign the value of the target attribute, back to the source module object.
This was designed to work with single-valued or multi-valued enumerations.
The original intention of the DXL was to reflect the assignment of a requirement (by functional group)
from one module to another. It was intended to maintain assigned responsibility of a requirement
across modules.
Does this appear to be realted to what you are trying to accomplish?
I would be happy to share this dxl code if it will help you.

-------------------------
John Segelbacher
Report this to a Moderator Report this to a Moderator
 7-Mar-2003 22:03
User is offline View Users Profile Print this message


Deniz Akkor

Posts: 18
Joined: 26-Feb-2003

John,

I appreciate if you upload the script to the forum of you can email it to my email address, denakkor@aol.com.

Den
Report this to a Moderator Report this to a Moderator
 14-Dec-2007 10:49
User is offline View Users Profile Print this message


Elbert Mol

Posts: 10
Joined: 11-Dec-2006

My Target module is named Vragenlijst
My Source module is named Actual

The absolute numbers are identical for the objects of which I want to copy the attribute content (text)

The attribute name is Opmerking

How do I get the code of Mark Philips running?

Edit:
Working code found. No answer neccesary anymore.

Edited: 14-Dec-2007 at 14:01 by Elbert Mol
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.