Search code examples
ibm-doors

How to Iterate over source objects of incoming links in DXL, in Modules not previously loaded


my question is quite the same as this one : How to Iterate over target objects of outgoing links in DXL, in Modules not previously loaded

but regarding incoming links.

I would like to use the source objects of incoming links but there are located in module that are not previsously loaded.

I don't want to open and close module each time because it would cost too much time. I would like to open them once and close them at the end.

Two solution for this :

  • be able to know if the module is already open or not so that I don't open it again (is there a "is_open" function in DXL + store the list of open module in a table and close them all at the end.

or better :

  • before start of loop, use a loop using the link module and the target module to find all module in the database that could be linked to the target module. And I load them all (even if there is no links between them. But my script would be simpler this way). How can I do this ? I tried something like :

ModName_ src_mod_linkset for src_mod_linkset in "target_module"<-"linkmodulename" do { print "test" }

but in this kind of loop, it doesn't work because "target_module" should be an object and not the complete module.


Solution

  • https://www.ibm.com/mysupport/s/forumshome has a lot of information on this. A query "Engineering Requirements Management DOORS" incoming links brings you some example scripts. I prefer this approach (load the ModuleVersion if its data is null): https://www.ibm.com/mysupport/s/forumsquestion?language=de&id=0D50z00006HIDztCAH

    About "is_open": there is a loop for module in database, which gives you a list of all open modules. You might want to store all open modules at the star of your script in a Skip list and when iterating over the incoming modules check to see whether you have to close the module at the end of your script.

    I would not use your second approach if you plan to run your script on baselines, it might happen that the link set in the link module has been deleted in the meantime, so you will not get all possible in links. Anyway, the link modules could be anywhere in your database, not necessarily near your incoming module.