Is there a direct conntection from Link to LinkRef?

Hello
 

LinkRef lnkRefWork;
for lnkRefWork in (objSource<-sLinkModuleName) do {
}

 

We all know the loops running over all Links resp. LinkRefs. Inside a Linkref I want to place the line:

 

 

Object objSource = source(lnkRefWork);



But the source() only accepts a Link as a parameter.

So we have to use two loops.

Any ideas to reduce this?

Best regards
Wolfgang



 

 


SystemAdmin - Tue Jan 29 03:06:40 EST 2013

Re: Is there a direct conntection from Link to LinkRef?
SystemAdmin - Tue Jan 29 11:19:50 EST 2013

As you previously stated do what a politician does, rename your two loops as one and claim success.

Re: Is there a direct conntection from Link to LinkRef?
SystemAdmin - Tue Jan 29 11:36:15 EST 2013

You could use the LinkRef to get the module name and absolute number of the source object. You can then use that info to get the source object directly:
 

LinkRef lnkRefWork;
for lnkRefWork in (objSource<-sLinkModuleName) do {
    ModName_ srcModRef = source(lnkRefWork)
    int srcAbsNum = source(lnkRefWork)
    Module srcMod = read(fullName(srcModRef), false)
    Object objSource = object(srcAbsNum, srcMod)
}

Re: Is there a direct conntection from Link to LinkRef?
llandale - Tue Jan 29 13:23:20 EST 2013

No, I see no translation of LinkRef to Link, without a 2nd loop.

I dislike the "object(AbsNo)" command as it is restricted to the current display set which is restricted to the default view for the module.

I think you are stuck with the customary approach:
  1. LinkRef loop to open source module
  2. Link loop to find source objects

-Louie

Re: Is there a direct conntection from Link to LinkRef?
Mathias Mamsch - Tue Jan 29 14:42:23 EST 2013

Well I am not sure what your intention is - if you want minimal code, then make a library function that will give you all the inlinks. You need to understand that LinkRefs and Links are two completely different things in DOORS. A Link is something with a start object and an end object that is loaded to memory with the start object or the module it is contained in. Before the module containing the start object is loaded to memory, it does not exist from a DOORS perspective.

The LinkRef is the little yellow in-link marker, that is placed on an object to indicate that there is a link ending from somewhere on that object. You need this LinkRef only, to find out, which modules to open, so all links will that end in the module will be loaded to memory. If for example you already knew the modules from where you receive links, then you could just open them without thinking about LinkRefs and then iterate over Links directly. Therefore you can see, why there is

a) no connection between Link and LinkRef -> these are separate things.
b) no source function for the LinkRef -> a LinkRef is no link, therefore it does not carry information about the link, like creation dates, etc.
c) you need to explicitly have a loop to open the source modules, and the real loop to iterate over the links

Maybe that clears matters up, regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Is there a direct conntection from Link to LinkRef?
SystemAdmin - Wed Jan 30 01:39:56 EST 2013

Mathias Mamsch - Tue Jan 29 14:42:23 EST 2013
Well I am not sure what your intention is - if you want minimal code, then make a library function that will give you all the inlinks. You need to understand that LinkRefs and Links are two completely different things in DOORS. A Link is something with a start object and an end object that is loaded to memory with the start object or the module it is contained in. Before the module containing the start object is loaded to memory, it does not exist from a DOORS perspective.

The LinkRef is the little yellow in-link marker, that is placed on an object to indicate that there is a link ending from somewhere on that object. You need this LinkRef only, to find out, which modules to open, so all links will that end in the module will be loaded to memory. If for example you already knew the modules from where you receive links, then you could just open them without thinking about LinkRefs and then iterate over Links directly. Therefore you can see, why there is

a) no connection between Link and LinkRef -> these are separate things.
b) no source function for the LinkRef -> a LinkRef is no link, therefore it does not carry information about the link, like creation dates, etc.
c) you need to explicitly have a loop to open the source modules, and the real loop to iterate over the links

Maybe that clears matters up, regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Hello

Thanks for the answer. My Intention is: Two loops seems to look like a little oversized code and I thought to reduce it. But if I cannot - ok.

Best regards
Wolfgang

Re: Is there a direct conntection from Link to LinkRef?
SystemAdmin - Wed Jan 30 02:10:21 EST 2013

SystemAdmin - Tue Jan 29 11:19:50 EST 2013
As you previously stated do what a politician does, rename your two loops as one and claim success.

> As you previously stated do what a politician does, rename your two loops as one and claim success.

You cannot alter the internal structure of a thing by renaming it. A renamed problem is still a problem. But a renamed solution is a solution. It may me to expensive, to complicate, stupid, senseless or whatever. The most important point is: You have a solution and the other has not.

P.S.: It is very strange here. Sometimes the editor gimicks work and sometimes not.