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: Baseline Copy in DXL
Topic Summary: baseline copy
Created On: 2-Aug-2006 22:54
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.
 2-Aug-2006 22:54
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

Hi,
I would like to copy a baseline with the following code.
The ModName_ is not getting anything, I don't even know what it suppose to be.

Also, what is ModuleRef__ and ModName_, anyway?
Thank you.
Report this to a Moderator Report this to a Moderator
 3-Aug-2006 22:23
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

Never mind I got it, and here is the result...
Report this to a Moderator Report this to a Moderator
 1-Sep-2006 20:57
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

I am trying to use the code given in this thread to copy a baseline module. I tried to understand the code before applying to a baseline. I am stumped at many points, where I made some comments. Maybe some are silly doubts. Then I tried to apply this code to a baseline module. It did not work. Will the experts please elaborate more on the comments raised by me?
Thanks in advance.
Report this to a Moderator Report this to a Moderator
 11-Sep-2006 13:52
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

Hi,

This script copy the Baseline by first creating a new module and then iterating all objects in the baseline and creating a new object in the new module.
So:
set function is a DOORS system function, that sets the same value of some existing attribute, like VV (constant string VV = "Some Attribute").

Also since the script creates new objects, I decided to create a new attribute to hold the ID of the source object ("Base ID") this way I can link later.

CopyObjects function is the key in the entire script, this function is a recursive function that calls itself. The problem was that if you try to just do a "for o in Module", you will iterate through all objects in order they are displayed, and have no knowledge of their structure. So you need to know their individual level, who is parent who is leaf. Think about this function as sitting in the top of the tree going to each branch so something and then go to the first sub branch and do the same thing and move to the next sub branch. When you get to the leaf go to the next leaf and do something and so on. Do something is transferData(from object base, to object new). 

void copyObjects(Object b, Object n) {
  transferData(b, n)         - > do something
  if(!null (first b))            --> you got children, go there
    copyObjects(first b, create(below n)) -
      |-> so call itself with the next child base object and create a new child object (one level down) 
          to hold this data
  if(!null (next sibling b))  --> you got a next sibling, same level
    copyObjects(next sibling b, create n)
      |--> call itself with this next base sibling and create a new object at the same level to hold data
}

I hope this helps, somehow,
Octavian

Report this to a Moderator Report this to a Moderator
 18-Sep-2006 15:53
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Hi,
Thanks for the detailed explanation. I am still to apply the code to copy a baseline module. I'll post my comments after I do the job.

- Krishna

Report this to a Moderator Report this to a Moderator
 12-Mar-2007 16:50
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

I compiled the attached code to copy the latest baseline of a module.

- Krishna
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.