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: Copy object text from one module to attribute in another
Topic Summary:
Created On: 25-Apr-2005 14:21
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.
 25-Apr-2005 14:21
User is offline View Users Profile Print this message


Michael Venos

Posts: 20
Joined: 26-May-2004

I have two modules with links between them. I am trying to find a way so that whenever I update the object text in an object in one module, that text is automatically copied over to an attribute of the object it is linked to in the other module. Has anyone tried to do this before? I have had little experience with DXL and am unsure of how to approach this problem... Any help would be greatly appreciated...
Report this to a Moderator Report this to a Moderator
 25-Apr-2005 16:55
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You can write an on-demand program to do it, figuring to run it every day.

You can write an Attribute DXL script. Such a script presumes the "current" obj and gets defined when you create the attribute; presumably in this case type Text. Such an Attr DXL migh look as attached:

The AttrDXL runs at module load time.

New to AttrDXL? Try this: Create a new attribute named "Test AttrDXL", for objects only, turn off inherit etc properties, type is Text, select the DXL attribute option, [Browse], [Current], type in the following two lines:
string Value = obj."Absolute Number" ""
obj.attrDXLName = "AbsNo = " Value " " dateOf(intOf(today())) "" // looks like "AbsNo = 1234 11:22:47 25:04:05"
[Check], [OK], [OK], ...

Then insert Test AttrDXL in a column and look at the results. Note that you can manually modify these values but it doesn't make any sense to do so.

Close the module, reopen it, and look at the column. The time should have changed a little bit.

- Louie
Report this to a Moderator Report this to a Moderator
 25-Apr-2005 19:36
User is offline View Users Profile Print this message


Edward Bauer

Posts: 1
Joined: 25-Apr-2005

Thank you for the reply - I'm working with Mike on this. Another question - Do you know the code for "TargetValue = the Attr Value of the object at the other end of the link" This is the step right now that I'm stuck on. I don't know how to copy and paste text into another module other then current. Thanks so much for any more help.
Report this to a Moderator Report this to a Moderator
 26-Apr-2005 18:31
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Look in the manual for "LinkRef"; you'll need to use that loop to first open up the target module. Then you'll have something that looks like attached.

Advanced DXL requires the following:
AttrValue = "" // in case of error below
noError()
AttrValue = oTarget."TheOtherAttributeName"
string ErrMess = lastError() // prevent attr retrieval from aborting, such as if the Attr doesn't exist
if (!null ErrMess) report the error

This prevents the attr retrieval code from aborting your entire DXL, which would happen if the Attribute doesn't exist or you don't have read access. You'll need to get used to bullet proofing your code like that. And when that gets real annoying, as it does quickly, you'll end up writing library functions to do this chores like fGetAttrVal, fGetAttrValRich, fSetAttrVal, yaddy yaddy.

- Louie
Report this to a Moderator Report this to a Moderator
 21-Jun-2005 13:33
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

Hi
I have a script for doing this but it requires user input
run it on any Module which has links
it might require some customization for u r use.

Let if know if u need it mail to : tarun.inabathuni@in.bosch.com

Regards

Tarun
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.