Topic
  • 4 replies
  • Latest Post - ‏2013-03-11T12:41:09Z by kabr
kabr
kabr
115 Posts

Pinned topic getting a linkset handle from a link module descriptor

‏2013-03-07T13:56:03Z |
Hi all,

I searched the forum but could not find an answer to my question:

is there a way to get a linkset handle when I have a linkModuleDescriptor handle?

Thanks in advance.

Karl
Updated on 2013-03-11T12:41:09Z at 2013-03-11T12:41:09Z by kabr
  • Mathias Mamsch
    Mathias Mamsch
    2003 Posts

    Re: getting a linkset handle from a link module descriptor

    ‏2013-03-07T18:17:31Z  
    Yes. From the LinkModuleDescriptor find the link module and open it. Iterate through the linksets until you find the one with the source and target of the LinkModuleDescriptor. Note that you might not always find one, since you can have a linkModuleDescriptor without a linkset existing for it, even without the modules existing.

    So no there is no function, that will do it for you. Why would you even need that? Test if a linkset exists for a linkmodule descritor? Regards, Mathias


    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
  • kabr
    kabr
    115 Posts

    Re: getting a linkset handle from a link module descriptor

    ‏2013-03-08T09:00:37Z  
    Yes. From the LinkModuleDescriptor find the link module and open it. Iterate through the linksets until you find the one with the source and target of the LinkModuleDescriptor. Note that you might not always find one, since you can have a linkModuleDescriptor without a linkset existing for it, even without the modules existing.

    So no there is no function, that will do it for you. Why would you even need that? Test if a linkset exists for a linkmodule descritor? Regards, Mathias


    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
    I have a dialog box that shows the LMDs listed in a module's properties, and a user can select the LMDs he wants to delete.
    I was wondering if I could delete the related linksets and links as well from this dialog box.

    Karl
  • llandale
    llandale
    3010 Posts

    Re: getting a linkset handle from a link module descriptor

    ‏2013-03-08T18:27:55Z  
    • kabr
    • ‏2013-03-08T09:00:37Z
    I have a dialog box that shows the LMDs listed in a module's properties, and a user can select the LMDs he wants to delete.
    I was wondering if I could delete the related linksets and links as well from this dialog box.

    Karl

    Deleting the LMD means the module is no longer has the contraints (or benefits) from the LMD; it has nothing to do with LinkSets or Links. If you are assigned a parking spot at work and we de-assign it, then you still have a car and the spot still exists. The "assignment" is just a piece of information, neither a car nor a spot.

    A MM said, you can take the Source/Destin/LinkMod full name information in the LMD, open the LM edit, and find the LinkSet. If you delete the LinkSet then all the "Links" end up being deleted (but I'm not sure how).

    Let me scribble; find the commands and attr names yourself:

    NameLM = module(lmd)
    NameSource = source(lmd)
    NameTarget = target(lmd)
    mCurr = current    // Remember original current Module
    Module mLM = edit(NameLM, false, true, true)  // Open Link Module
    if (null mLM) then No Such LM
    mLM = current
    for o in mLM do
    {  LsSource = o."Source Something"
       Lstarget = o."Target Something"
       if (LsSource == NameSource and
           LsTarget == NameTarget)
       {       // Found LinkSet
          LinkSet ls = linkset(o)
          delete(ls)
          flushDeletions()
          save(mLM)
       }
    }
    close(mLM)
    current = mCurr    // reinstate Current Module
    


    -Louie

    Updated on 2014-01-09T00:08:50Z at 2014-01-09T00:08:50Z by iron-man
  • kabr
    kabr
    115 Posts

    Re: getting a linkset handle from a link module descriptor

    ‏2013-03-11T12:41:09Z  
    Thank you, Mathias and Louie,

    I am aware of the difference between LMD and linkset and all its aspects and implications.
    But I like your analogy, Louie. Maybe I will use it next time I try to explain the difference to one of my users.

    With your suggestions I am able to do what I want.
    Thanks again.

    Karl