Delete specific links for an object

hi all,

 

I am looking for the dxl script where it should delete the specific links motioned in the attribute. As we have link by attribute, is there a script for delete by attribute


Mahadevanna - Sun Apr 13 10:42:33 EDT 2014

Re: Delete specific links for an object
Mathias Mamsch - Tue Apr 15 07:39:23 EDT 2014

I wonder if it could be sufficient for you to delete the linkset (to get rid of all links) and recreate the links from the link by attribute script. In the end the links are only an automatically generated artefact of your attribute, so it should not matter to delete/recreate them. And excluding certain links in the link by attribute script is even easier than create the "reverse" script. However that is also possible of course - if you have concrete problems in coding that script, post back here.

In any case you should avoid editing links AND attributes. So one must be the 'master' or you will get to know consistency hell...

Regards, Mathias

Re: Delete specific links for an object
Mahadevanna - Tue Apr 15 07:45:02 EDT 2014

Thanks for the reply , actually i do want to delete all the links at a time.

Now i have a object where some links are already there , now in an excel sheet i will get which links need to deleted . Only those links i need to delete and this goes for around thousands of requirements. I can not touch linkset, nor i can delete all the links.

Re: Delete specific links for an object
GregM_dxler - Tue Apr 15 14:28:09 EDT 2014

Mahadevanna - Tue Apr 15 07:45:02 EDT 2014

Thanks for the reply , actually i do want to delete all the links at a time.

Now i have a object where some links are already there , now in an excel sheet i will get which links need to deleted . Only those links i need to delete and this goes for around thousands of requirements. I can not touch linkset, nor i can delete all the links.

Doors provides a method to delete all the links, or only certain ones by using the selection under Link.

In some cases, I've seen where people use attributes in the link module to mark whether a link has been validated or not, and in other cases, people have used link creation dates to check if a change has been made.  So, in these case, it is not okay to just delete all the links and recreate them since they will affect both of these.  (By the way, I'm not condoning these methods, just that I've seen them).

The DOORS provided link by attribute script will only add links, not remove existing ones.  So, what I have done is to add functionality that would check the existing links to what is in the link by attribute attribute and delete the links that are no longer in the list.

Of course, both methods, the Doors Link->Delete or the Link by Attribute methods assumes you have write capability to the source module of the links.  Without that, you can't delete the links.

Hope that helps,

Greg

Re: Delete specific links for an object
Mahadevanna - Tue Apr 15 22:26:27 EDT 2014

GregM_dxler - Tue Apr 15 14:28:09 EDT 2014

Doors provides a method to delete all the links, or only certain ones by using the selection under Link.

In some cases, I've seen where people use attributes in the link module to mark whether a link has been validated or not, and in other cases, people have used link creation dates to check if a change has been made.  So, in these case, it is not okay to just delete all the links and recreate them since they will affect both of these.  (By the way, I'm not condoning these methods, just that I've seen them).

The DOORS provided link by attribute script will only add links, not remove existing ones.  So, what I have done is to add functionality that would check the existing links to what is in the link by attribute attribute and delete the links that are no longer in the list.

Of course, both methods, the Doors Link->Delete or the Link by Attribute methods assumes you have write capability to the source module of the links.  Without that, you can't delete the links.

Hope that helps,

Greg

Hi Greg thanks for the reply . Did u attach any script becoz :So, what I have done is to add functionality that would check the existing links to what is in the link by attribute attribute and delete the links that are no longer in the list". i did not find any such things.

Re: Delete specific links for an object
GregM_dxler - Wed Apr 16 11:33:28 EDT 2014

Mahadevanna - Tue Apr 15 22:26:27 EDT 2014

Hi Greg thanks for the reply . Did u attach any script becoz :So, what I have done is to add functionality that would check the existing links to what is in the link by attribute attribute and delete the links that are no longer in the list". i did not find any such things.

Hi,

No, I did not attach script, figured you could figure it out from the explanation.  Maybe this will help you get started.

Greg


Attachments

Del_Links.dxl

Re: Delete specific links for an object
Mahadevanna - Thu Apr 24 09:29:47 EDT 2014

GregM_dxler - Wed Apr 16 11:33:28 EDT 2014

Hi,

No, I did not attach script, figured you could figure it out from the explanation.  Maybe this will help you get started.

Greg

thanks for the reply , but this script is around 22 errors, i am not able to debug the same 

Re: Delete specific links for an object
GregM_dxler - Thu Apr 24 11:59:33 EDT 2014

Mahadevanna - Thu Apr 24 09:29:47 EDT 2014

thanks for the reply , but this script is around 22 errors, i am not able to debug the same 

Hello,

The attachment is not a complete script, it is only the function that does the deleting of the links.  You need to integrate it into the link by attribute script.  The DOORS link by attribute script is located at DOORS9/lib/dxl/standard/links/link.dxl

Greg

Re: Delete specific links for an object
smarti.sj - Fri Apr 25 08:25:48 EDT 2014

How often are you going to run this script? nightly? occasionally?  If it will be part of a nightly "batch" job to update links I would advise against deleting all links and recreating them as this will generate a lot of history entries.  Instead, you could search the attributes values for the target objs of the current links and if they don't exist delete the links.

Re: Delete specific links for an object
Mahadevanna - Fri Apr 25 10:29:03 EDT 2014

GregM_dxler - Thu Apr 24 11:59:33 EDT 2014

Hello,

The attachment is not a complete script, it is only the function that does the deleting of the links.  You need to integrate it into the link by attribute script.  The DOORS link by attribute script is located at DOORS9/lib/dxl/standard/links/link.dxl

Greg

Hi ,

thanks for the reply , i tried to integrate the script but i am getting 11 errors and script is attached to the mail. Kindly help to avoid these errors


Attachments

link.dxl