![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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...
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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.
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.