Topic
2 replies Latest Post - ‏2013-10-28T15:28:10Z by llandale
chrisrelfy
chrisrelfy
1 Post
ACCEPTED ANSWER

Pinned topic Trying to re-establish a deleted link.

‏2013-10-25T08:57:37Z |

Hi,

I'm currently trying to re-establish a link to a module in DOORS that has been deleated. To do this I need to extract the target module name and absolute number of the target object using DXL. However, I'm not sure how to do this as I'm very new to using DXL.

I have found the code below using the DXL reference manual, but it is of no use, I was wondering if with modification it would be?

I have also attached an image of the deleted module if it helps!

const string LINK_HISTORY_ATTRNAME = "Link History"
Module m = current
if (m != null){
// get the value
bool linkHistoryBefore = m.(reserved LINK_HISTORY_ATTRNAME)
// set the value
m.(reserved LINK_HISTORY_ATTRNAME) = !linkHistoryBefore
// get the value again
bool linkHistoryAfter = m.(reserved LINK_HISTORY_ATTRNAME)
print "Before: " linkHistoryBefore "\n"
print "After: " linkHistoryAfter "\n"
}

Any questions about what I'm trying to do, feel free to ask.

Thanks in advance,

Chris

Attachments

  • BillTidy
    BillTidy
    28 Posts
    ACCEPTED ANSWER

    Re: Trying to re-establish a deleted link.

    ‏2013-10-25T18:07:09Z  in response to chrisrelfy

    Maybe I'm missing something here but.... you're trying to put back 1 link from 1 object in a module to 1 object in another module that was deleted (by mistake it seems)?

  • llandale
    llandale
    2939 Posts
    ACCEPTED ANSWER

    Re: Trying to re-establish a deleted link.

    ‏2013-10-28T15:28:10Z  in response to chrisrelfy

    Just in case: open the module, then the DXL window from the Tools menu of the module.  Then the "m = current" will work. 

    I see you got your code from the DXL manual.  Perhaps add "else print "no module open\n" at the end.

    I've never used "reserved", but your use seems to deal with History.  Using it at the module level just turns on/off History logging for Links.

    I think you will find it difficult to search History to reliably determine if a link "should" or "did" exist.  Even if History of Linking is on, you get no History when you delete the LinkSet or purge the target module or archive/restore the module, or when someone turns off History, links, and turns it back on.

    To search actual History, you will want to start off with

    • History hst
    • HistoryType ht
    • for hst in o do
    • {  ht = hst.type
    •    if (ht == deleteLink) then History is deletion of link
    •    if (ht == createLink) then History is creation of link
    • ...
    • }

    Be advised you get History only in the SOURCE object.  The target object of the link gets no History.

    Back to what you are trying to do.  Recreate deleted links?  Recreate links FROM a module you just undeleted?  Recreate links TO a module you just undeleted?  Recreate links to module M2 that already exist to a similar module M1?

    -Louie