Dear all, I have the following situation:
If I open Module A I see only inlinks from Current version of Module B, but if I open Baseline 1.0 I can see outlinks to Module A. Is there a way analyzing ModuleA to discover inlinks from Baseline 1.0 of Module B? My idea is to
Do you have better ideas?
Thanks in advance Dario Dario_Imparato - Thu Nov 23 06:43:30 EST 2017 |
Re: How to discover inlinks from Baseline you need to create BaselineSets; what your currently trying to do is not feasible. |
Re: How to discover inlinks from Baseline We had this scenario in some projects as well, the first tier of requirements has been created and baselined months before 2nd tier requirements and usage of BaselineSets was not feasible as there were many intermediate baselines in the lower level reqs.--- EDIT: Sorry, I confused the scenario, In my scenario you have links from current to baseline, but the script approach should be correct.
Concerning your approach, I would do it the other way round:
This way, you do not have to traverse B so often, this approach should be much faster. The structure of your HashMap depends on your needs, on how the output shall be formatted. When you put the information to the skip list at *), you will probably do it this way:
|
Re: How to discover inlinks from Baseline Thank you all, Mike I don't understand why your approach should be much faster. I know the baseline version so I don't need to iterate over all baseline. You iterate on all the objects of bl and create a sort of hashmap B_ID -> List of A_ID? Can you explain in details the key and the value of the following SkipList
Thanks in advance |
Re: How to discover inlinks from Baseline Dario_Imparato - Mon Nov 27 08:26:44 EST 2017 Thank you all, Mike I don't understand why your approach should be much faster. I know the baseline version so I don't need to iterate over all baseline. You iterate on all the objects of bl and create a sort of hashmap B_ID -> List of A_ID? Can you explain in details the key and the value of the following SkipList
Thanks in advance Hi Dario, well, I understood that your approach has an outer loop of all objects in Module A and an inner loop of all objects in Module B. So, if you have 1.000 Objects in A and 1.000 Objects in B, you will have 1.000.000 repetitions of the inner loop. If this script concerns not only two small modules but several big modules in the database, it might happen that there is a difference in the runtime. So, you have a concrete baseline version, that's good. In this case, your data structure can look exactly as you proposed (but still, this depends on how your report looks like):
Skip List Name: HashMap_A_B, key: integer, representing absolute Number of A. Value: inner Skip List inner Skip List : key: integer, representing absolute Number of B. Value: corresponding Object of B
With this structure, the code excerpt should be:
Object oB
Module mB = ... module of opened baseline of B ...
Skip HashMap_A_B = create()
for oB in mB do {
int absNoB = intOf(oB."Absolute Number""")
Link l
for l in (oB) -> ("*") do {
string destModule = target l
if (destModule == "A") {
Object oA = target l
int absNoA = intOf(oA."Absolute Number""")
Skip list_B_Objects
if (!find (HashMap_A_B, absNoA, list_B_Objects)) {
list_B_Objects = create()
put (list_B_Objects, absNoB, oB)
put (HashMap_A_B, absNoA, list_B_Objects)
} else {
// list_B_Objects has been initialized by the find command
put (list_B_Objects, absNoB, oB)
}
}
}
}
|
Re: How to discover inlinks from Baseline Mike.Scharnow - Mon Nov 27 10:02:53 EST 2017 Hi Dario, well, I understood that your approach has an outer loop of all objects in Module A and an inner loop of all objects in Module B. So, if you have 1.000 Objects in A and 1.000 Objects in B, you will have 1.000.000 repetitions of the inner loop. If this script concerns not only two small modules but several big modules in the database, it might happen that there is a difference in the runtime. So, you have a concrete baseline version, that's good. In this case, your data structure can look exactly as you proposed (but still, this depends on how your report looks like):
Skip List Name: HashMap_A_B, key: integer, representing absolute Number of A. Value: inner Skip List inner Skip List : key: integer, representing absolute Number of B. Value: corresponding Object of B
With this structure, the code excerpt should be:
Object oB
Module mB = ... module of opened baseline of B ...
Skip HashMap_A_B = create()
for oB in mB do {
int absNoB = intOf(oB."Absolute Number""")
Link l
for l in (oB) -> ("*") do {
string destModule = target l
if (destModule == "A") {
Object oA = target l
int absNoA = intOf(oA."Absolute Number""")
Skip list_B_Objects
if (!find (HashMap_A_B, absNoA, list_B_Objects)) {
list_B_Objects = create()
put (list_B_Objects, absNoB, oB)
put (HashMap_A_B, absNoA, list_B_Objects)
} else {
// list_B_Objects has been initialized by the find command
put (list_B_Objects, absNoB, oB)
}
}
}
}
Hi Mike, ok I understood now, thanks for your solution. I used the outer loop to be sure the objects in A are not deleted; if you navigate the outlinks of a baseline you could find yourself on a deleted object. I integrated the check in your code, lines 11-12. Thank you :) Dario
|
Re: How to discover inlinks from Baseline Dario_Imparato - Mon Nov 27 11:29:40 EST 2017 Hi Mike, ok I understood now, thanks for your solution. I used the outer loop to be sure the objects in A are not deleted; if you navigate the outlinks of a baseline you could find yourself on a deleted object. I integrated the check in your code, lines 11-12. Thank you :) Dario
Hi Dario, good idea. You might even change the outer loop to "for oB in entire mB do { if isDeleted oB then continue; ...} This way, you will also get objects in oB that are currently not visible if a filter is set in the default view. You are right in removing the conversion from Attr__ to string to int. Directly associating an Attr__ to a an integer variable is one of the cases where DXL works as expected :)
|
Re: How to discover inlinks from Baseline Hi Mike, good idea! Below is the complete code, it can be useful to others.
|