Topic
  • 9 replies
  • Latest Post - ‏2014-04-25T14:29:03Z by Mahadevanna
Mahadevanna
Mahadevanna
5 Posts

Pinned topic Delete specific links for an object

‏2014-04-13T14:42:33Z |

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

  • Mathias Mamsch
    Mathias Mamsch
    2183 Posts

    Re: Delete specific links for an object

    ‏2014-04-15T11:39:23Z  

    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

  • Mahadevanna
    Mahadevanna
    5 Posts

    Re: Delete specific links for an object

    ‏2014-04-15T11:45:02Z  

    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.

  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Delete specific links for an object

    ‏2014-04-15T18:28:09Z  

    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

    Updated on 2014-04-15T18:30:06Z at 2014-04-15T18:30:06Z by GregM_dxler
  • Mahadevanna
    Mahadevanna
    5 Posts

    Re: Delete specific links for an object

    ‏2014-04-16T02:26:27Z  

    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.

  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Delete specific links for an object

    ‏2014-04-16T15:33:28Z  

    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

  • Mahadevanna
    Mahadevanna
    5 Posts

    Re: Delete specific links for an object

    ‏2014-04-24T13:29:47Z  

    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 

  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Delete specific links for an object

    ‏2014-04-24T15:59:33Z  

    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

  • smarti.sj
    smarti.sj
    20 Posts

    Re: Delete specific links for an object

    ‏2014-04-25T12:25:48Z  

    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.

  • Mahadevanna
    Mahadevanna
    5 Posts

    Re: Delete specific links for an object

    ‏2014-04-25T14:29:03Z  

    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

    Updated on 2014-04-25T14:29:29Z at 2014-04-25T14:29:29Z by Mahadevanna