Hello,
(I could know all the identifiers of objects) I imagine the script like that : (no declaration) "For Object A in Module X, create a link in module "verifies" to object 1 in Module Y For Object B in Module X, create a link in module "verifies" to object 2 in Module Y For Object C in Module X, create a link in module "verifies" to object 3 in Module Y..." I hope to complete my Object A,B,C and object 1,2,3 in Excel, then to create a script in TXT and after to paste the script in DXL to run it. So each line is one link. Could you help me ? Thank's JM JeanMi - Mon Jul 19 05:20:58 EDT 2010 |
Re: Create links with a very simply script
Actually I have a similar script, which I run in conjunction with some other scripts to do link manipulations on a very low level. A nice idea (at least I think so), is that you just copy/paste the links from excel into a DXL dialog, and from there the script processes them. This way you don't have to put together some weird DXL from your Excel all the time (been there, done that).
#include <../lib/std/set.inc>
DB x = centered "Links paste pls"
DBE txt = text (x, "Paste the links:", "", 300,300,false)
block x
release x
Set lines = split(get txt, "\n")
string sLine
for sLine in getSkip lines do {
print "Processing line:" sLine "\n"
Set val = split(sLine, "\t")
if (count val > 6) {
string dir = val[4]
if (dir == "IN") { print "skipping in link.\n"; continue }
string sSrc = val[0]
int iNrSrc = intOf realOf (val[1] string)
string linkMod = val[5]
string sDst = val[6]
int iNrDst = intOf realOf (val[7] string)
print "Drawing link from " sSrc " object " iNrSrc " to " sDst " object " iNrDst "\n"
Module mSrc = edit (sSrc, true)
Module mDst = read (sDst, true)
if (null mSrc || null mDst) {
print "we are module seriously hosed ...."
print "Source:" sSrc "\n"
print "Dest:" sDst "\n"
continue
}
Object oSrc = object(iNrSrc, mSrc)
Object oDst = object(iNrDst, mDst)
if (null oSrc || null oDst) {
print "we are seriously hosed ...."
} else {
if (!null linkMod)
oSrc -> linkMod -> oDst
else
oSrc -> oDst
}
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Create links with a very simply script In fact I don't want to export a file. I'd like to know syntaxe of the link creation : Object source -> string linkModuleName -> Object target How to write that ? How to write this "Object source" and Object Target : Folder/Module name/ Id of the object source ?? string linkModuleName -> is my link module "verifies". That I have to use with http://.... ? Thank's for your help JM |
Re: Create links with a very simply script JeanMi - Mon Jul 19 12:05:42 EDT 2010
Bonjour Jean-Michel, o1->"My Link Module"->o2
|
Re: Create links with a very simply script In an Excel file, you would have column headings (aka attributes) similar to: ObjectIdentifier(X) ObjectText(X) ObjectIdentifier(Y) ObjectText(Y) where each line (aka object) represents a link from X to Y. What you would do is rename ObjectIdentifier(Y) to "Relates to" (without the quotes) and format that column as text. Rename the ObjectIdentifier(X) column to "Object Identifier" (without the quotes). Hide the other two columns so you only have the "Object Identifier" and "Relates to" columns. Save that as a tab separated text file. Rename it as <filename>.tsv, then do File->Import->Spreadsheet... in DOORS to update the existing object. Once you have the "Relates to" field imported as Text, you can use Link->Advanced->Link by Attribute.. in DOORS to link you Source to the Target using the Relates to attribute to control the linking. |