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: Deleting baselines...
Topic Summary:
Created On: 1-Jun-2006 12:17
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.
Answer This question was answered by Bob Greaves, on Friday, June 23, 2006 4:36 PM

Answer:
!! Thanks Louie, that did the trick.
Thanks to everyone else who put there 2 cents in too (especially Hubertus)

Bob.
 1-Jun-2006 12:17
User is offline View Users Profile Print this message


Bob Greaves

Posts: 16
Joined: 15-Aug-2005

Does anyone know of a clever way to delete all but the LAST baseline in all modules from an entire DOORS database?  I'd rather not have to do this manually 'cus it'll take me months!

Many thanks,

Bob.

Report this to a Moderator Report this to a Moderator
 1-Jun-2006 12:24
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

Hi Bob,

if you don't mind that the basline Id remains try the following: copy a folder/project and paste it else where in the DB. The baselines are not copied! It is the first time, that I would call it a feature, else it is a bug for me, that baselines get lost by copy+paste. :-)

Just an idea, but in this case you loose all including the LAST baseline...

Regards
Hubertus

Edited: 1-Jun-2006 at 12:26 by Hubertus Grobbel
Report this to a Moderator Report this to a Moderator
 1-Jun-2006 14:43
User is offline View Users Profile Print this message


Bob Greaves

Posts: 16
Joined: 15-Aug-2005

Hi Hubertus,
Thanks for the info, but we do need to keep that last baseline.
 I gorra horrible feeling that I'd need dxl to do exactly what I need, but a dxl programmer I'm not.

Thanks,

Bob.
Report this to a Moderator Report this to a Moderator
 1-Jun-2006 15:55
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

Hi Bob,

attached you find a piece of code.

This does nothing unless you comment out line 32 ...delete ... Only a printout is done to show what would be done.

Be sure to test it very carefully in a safe folder at first. Afterwards use the second main loop to apply to whole db(!) and enable deletion of baselines in you db-policy if not yet enabled and disable afterwards. This code is delivered as is without any warranty! This cannot be stated more clear at this point.

Furthermore you know community means give and take :-)

Regards
Hubertus

Edited: 1-Jun-2006 at 16:02 by Hubertus Grobbel
Report this to a Moderator Report this to a Moderator
 1-Jun-2006 23:48
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Just a nit-pick. I notice you are cleverly finding all the Baselines and storing them in a Skip list; where the "key" is a integer sequencer. That's good practice; do it also for all sorts of other things like Links. That's good because [1] if a library function you call from within your loop ALSO does a baseline loop, the outer loop will get lost (DXL really bytes) [2] if you delete a baseline from within a baseline loop, the loop will also get lost (DXL really bytes).

Anyway, the Sequencer insures that you retrieve the baselines from the skip in the same order that they were inserted. Thus, you only need "for bCurr in sklBaselines do" to get them out in correct order, since this Skip loop retrieves them in KEY sorted order; integer in this case.

Do you need to save(mCurrentMod) before closing it?

I'd trap the delete(mCurr, bCurr) errors like this:
noError()
delete(mCurr, bCurr)
string ErrMess = lastError()
if (!null ErrMess) then baseline didn't delete...

- Louie
Report this to a Moderator Report this to a Moderator
 2-Jun-2006 13:31
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

Hi Louie,

good point with the second delete-loop. In Germany we say, shooting with cannons on sparrows, if a solution is inadequate complex.

I simply shook my libraries and out came the script :-)

I am not sure whether it is necessary to save the currmod, woud not expect, but it's good to have it in mind. Also the error-trapping is a reasonable addon combined with an error output to show the admin, that the operation did not work out completely.

Looking forward to the reports of Bob and his final way of doing....

Regards
Hubertus
Report this to a Moderator Report this to a Moderator
 2-Jun-2006 19:59
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Here in Japan we say "Don't use an axe to remove a fly from a friends head". OK, that's China and not really "here".

Here in the US we say "KISS: Keep it simple, stupid". It could have been "Hey Stupid: Keep it Simple" but "HSKIS" isn't a good acronym. Well, actually we usually drag it on and on: "The increasing capabilities of a system and are related to the inverse of the system's capabilities, and the mis-understanding of a system is related to the expential increasing of its complexity". Well, we actually say it correctly. Well, not actually "we" but more like just "me"...

- Louie
Report this to a Moderator Report this to a Moderator
 23-Jun-2006 11:57
User is offline View Users Profile Print this message


Bob Greaves

Posts: 16
Joined: 15-Aug-2005

Many thanks, Hubertus, for your help, I'm sorry I didn't thank you earlier, I was away on business.

There is one problem tho...
when I run this script as either dbAdmin or Administrator I get the following dxl error....

The user 'Administrator' has insufficient access rights for this operation.

Any clues as to how I might get around this one?

Many thanks,

Bob.

Report this to a Moderator Report this to a Moderator
 23-Jun-2006 16:26
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I think the module needs to be opened for "edit" not "read", and after "deleteBaselinesExceptLast" the module should be "save"d.
Report this to a Moderator Report this to a Moderator
 23-Jun-2006 16:36
User is offline View Users Profile Print this message


Bob Greaves

Posts: 16
Joined: 15-Aug-2005

Answer Answer
!! Thanks Louie, that did the trick.
Thanks to everyone else who put there 2 cents in too (especially Hubertus)

Bob.
Report this to a Moderator Report this to a Moderator
 27-Jun-2006 09:21
User is offline View Users Profile Print this message


Hubertus Grobbel

Posts: 58
Joined: 3-May-2005

Hi Bob,

thanks for your nice feedback!

Regards
Hubertus

www.issc.de is your partner for software systems and requirements management.
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.