Hello! I'm looking for some DXL/DOORS help... I have 3 modules: A, B, and C. B is linked in to A, and C is linked in to B. So B is depth 1 and C is depth 2. I am trying to create a column in A that displays the object text, module name, and object number of the inlinked objects from B and C. However, I do not want to display all 3 of these (text, name, number) for both B and C--instead I'd like to only display the object text from B and the module name and object number from C. Ideally I want the info from C to be in square brackets immediately following the info from B. I would like it to look like this: Within a column in A: "object text from B" ["module name of C" "object number of C"] I have used the wizard to create the below layout DXL script, but currently it shows all 3 pieces of information for both B and C. Does anyone have any suggestions on how to print out only object text from B (depth 1), followed by module name and object number from C (depth 2)? Note: In the below script, I tweaked the end to display s, p, and t in the order I would like them.
sreed1141 - Mon Oct 27 19:28:49 EDT 2014 | ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? If I understand you correctly, you want one line with information from two different objects. The linked object in module B and the linked object in module C. That would not be too difficult to achieve. However, there are some situations that you might have to handle. 1. If there is no link from module C, what should be displayed? "object text from B" [] ? 2. If there are multiple links from module C? "object text from B" ["module name of C" "object number x of C"] "object text from B" ["module name of C" "object number y of C"] the easy way would then be to make the variables s, p and t global, set them in showIn depending on the value of depth like
the problem would then be to display the information. If there are links from C just add
last where you set s and p, but that leaves the situation where there is no linked object from C... which I suppose could be solved using a global boolean that is set to true every time you get an object at level 2 and set s and p, and is set to false where you set t. Then check if there was a C object after having called showIn for level 2. Something like
/sekrbo
| ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sekrbo - Tue Oct 28 05:17:51 EDT 2014 If I understand you correctly, you want one line with information from two different objects. The linked object in module B and the linked object in module C. That would not be too difficult to achieve. However, there are some situations that you might have to handle. 1. If there is no link from module C, what should be displayed? "object text from B" [] ? 2. If there are multiple links from module C? "object text from B" ["module name of C" "object number x of C"] "object text from B" ["module name of C" "object number y of C"] the easy way would then be to make the variables s, p and t global, set them in showIn depending on the value of depth like
the problem would then be to display the information. If there are links from C just add
last where you set s and p, but that leaves the situation where there is no linked object from C... which I suppose could be solved using a global boolean that is set to true every time you get an object at level 2 and set s and p, and is set to false where you set t. Then check if there was a C object after having called showIn for level 2. Something like
/sekrbo
Hi Sekrbo, Thank you very much for your reply and help. Your answer worked great. I modified the very last part, so that if there is no inlink from C, only t is displayed. This way I don't have empty square brackets when there is no C inlink (better for my document formatting):
I have a remaining issue though, which is something you asked at the beginning of your reply. 2. If there are multiple links from module C? It's a little complicated because I actually have different C's (C1, C2...) linking in to any given object in B. Also for the same C, I have different objects within it linking in to any given object in B. I would like these two situations to be handled differently, but I do not know if that's possible/difficult. I would want it to look like below: "object text from B" ["module name of C1" "object number x of C1"; "module name of C2" "object number x of C2"] and "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"] Further, these two sitautions often occur at the same time, where C1 and C2 objects are linking in to B, and multiple objects from C1 or C2 are linking in to B as well. So overall, I would like it to look like: "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"; "module name of C2" "object number x of C2", "object number y of C2"] Right now the way your script is written (which 100% addressed my first question), "object text from B" (variable t) gets displayed repeatedly for each inlinked C object, instead of just once followed by the list of many C objects. I realize this is more complicated than my original question, but I thought I would ask just in case you had any ideas. I appreciate it.
| ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sreed1141 - Tue Oct 28 13:23:00 EDT 2014 Hi Sekrbo, Thank you very much for your reply and help. Your answer worked great. I modified the very last part, so that if there is no inlink from C, only t is displayed. This way I don't have empty square brackets when there is no C inlink (better for my document formatting):
I have a remaining issue though, which is something you asked at the beginning of your reply. 2. If there are multiple links from module C? It's a little complicated because I actually have different C's (C1, C2...) linking in to any given object in B. Also for the same C, I have different objects within it linking in to any given object in B. I would like these two situations to be handled differently, but I do not know if that's possible/difficult. I would want it to look like below: "object text from B" ["module name of C1" "object number x of C1"; "module name of C2" "object number x of C2"] and "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"] Further, these two sitautions often occur at the same time, where C1 and C2 objects are linking in to B, and multiple objects from C1 or C2 are linking in to B as well. So overall, I would like it to look like: "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"; "module name of C2" "object number x of C2", "object number y of C2"] Right now the way your script is written (which 100% addressed my first question), "object text from B" (variable t) gets displayed repeatedly for each inlinked C object, instead of just once followed by the list of many C objects. I realize this is more complicated than my original question, but I thought I would ask just in case you had any ideas. I appreciate it.
That does make it more complicated. I would try using two skiplists, which are cleared for each module X object. Then for each C module, populate one list with the module name and the second with a concatenation of module name and object number for the key, and object number for the data. you would then have to remove all the displaying in the level two iteration and add an output in an else after if (bCobj). Here you would have to first find all of the C module names and then all of the objects in the second skiplist containing that module name in the key. I haven't tested it but something like this?
Now these deleting and creating skiplists, I don't know how efficient that is, I really would like to find a perm empty (Skip sk)!
/sekrbo | ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sekrbo - Wed Oct 29 05:32:22 EDT 2014 That does make it more complicated. I would try using two skiplists, which are cleared for each module X object. Then for each C module, populate one list with the module name and the second with a concatenation of module name and object number for the key, and object number for the data. you would then have to remove all the displaying in the level two iteration and add an output in an else after if (bCobj). Here you would have to first find all of the C module names and then all of the objects in the second skiplist containing that module name in the key. I haven't tested it but something like this?
Now these deleting and creating skiplists, I don't know how efficient that is, I really would like to find a perm empty (Skip sk)!
/sekrbo > I really would like to find a perm empty (Skip sk)! there is one. It's undocumented, but works without any problem since v8.2
| ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? Mike.Scharnow - Wed Oct 29 05:46:16 EDT 2014 > I really would like to find a perm empty (Skip sk)! there is one. It's undocumented, but works without any problem since v8.2
Interesting! As you said undocumented, the only setEmpty in the DXL Help is void setempty(Buffer b)! Then again probeRichAttr is undocumented as well :) /sekrbo | ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sekrbo - Wed Oct 29 05:54:23 EDT 2014 Interesting! As you said undocumented, the only setEmpty in the DXL Help is void setempty(Buffer b)! Then again probeRichAttr is undocumented as well :) /sekrbo Sekrbo, that worked exactly as hoped. Thank you for your time and reply. It is really generous that people on this forum provide answers to those of us who are trying to learn how to program | ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sekrbo - Wed Oct 29 05:32:22 EDT 2014 That does make it more complicated. I would try using two skiplists, which are cleared for each module X object. Then for each C module, populate one list with the module name and the second with a concatenation of module name and object number for the key, and object number for the data. you would then have to remove all the displaying in the level two iteration and add an output in an else after if (bCobj). Here you would have to first find all of the C module names and then all of the objects in the second skiplist containing that module name in the key. I haven't tested it but something like this?
Now these deleting and creating skiplists, I don't know how efficient that is, I really would like to find a perm empty (Skip sk)!
/sekrbo Hello again, I have been trying to make an edit to the code you provided, and I have tried lots of different ideas, but I cannot seem to get it to work. In the code you provided, the output looks like: "object text from B" ["module name of C1", "object number x of C1", "object number y of C1"; "module name of C2", "object number x of C2", "object number y of C2"] But I actually need the commas after the module names to be gone... More like this: "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"; "module name of C2" "object number x of C2", "object number y of C2"] I realize this is a very small difference, but it is pretty crucial. I thought it would be an easy fix, but I have not yet been able to get it working. I have tried adding in an addition boolean and if statement in the for loop for p. I have also tried moving this new if statement around in different places/orders. What I want to say is: if p follows s, display p but if p follows p, display ", " p This way there would be no comma between s and p, and only a comma between p and the next p, as desired. Right now, my code I believe says: the first p that occurs, display p all following p, display ", " p Here it is:
Any insight about this? I hope I am not taking advantage of your helpfulness. I can always post it back on the main forum.
| ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sreed1141 - Wed Oct 29 20:40:02 EDT 2014 Hello again, I have been trying to make an edit to the code you provided, and I have tried lots of different ideas, but I cannot seem to get it to work. In the code you provided, the output looks like: "object text from B" ["module name of C1", "object number x of C1", "object number y of C1"; "module name of C2", "object number x of C2", "object number y of C2"] But I actually need the commas after the module names to be gone... More like this: "object text from B" ["module name of C1" "object number x of C1", "object number y of C1"; "module name of C2" "object number x of C2", "object number y of C2"] I realize this is a very small difference, but it is pretty crucial. I thought it would be an easy fix, but I have not yet been able to get it working. I have tried adding in an addition boolean and if statement in the for loop for p. I have also tried moving this new if statement around in different places/orders. What I want to say is: if p follows s, display p but if p follows p, display ", " p This way there would be no comma between s and p, and only a comma between p and the next p, as desired. Right now, my code I believe says: the first p that occurs, display p all following p, display ", " p Here it is:
Any insight about this? I hope I am not taking advantage of your helpfulness. I can always post it back on the main forum.
I think the problem is that the second bool bFirst is about the 'inner itteration' the output that you are creating for each C module, therefore you cannot set bFirst = true for each B object. That is you have to set it for each Cmodule, and that is in the first skiplist loop. So add this
and remove the one in
Oh and as Mike said you seem to be able to change
to
Well hope that works, it's Friday evening...
/sekrbo
| ||||||||||||||
Re: How to display selected attributes for selected levels in DOORS using DXL? sekrbo - Fri Oct 31 16:42:47 EDT 2014 I think the problem is that the second bool bFirst is about the 'inner itteration' the output that you are creating for each C module, therefore you cannot set bFirst = true for each B object. That is you have to set it for each Cmodule, and that is in the first skiplist loop. So add this
and remove the one in
Oh and as Mike said you seem to be able to change
to
Well hope that works, it's Friday evening...
/sekrbo
Thanks for the reply. I tried your suggestion, but it did not seem to change anything. I will have to think about it some more to figure out what is going on and where the problem with the looping is. Happy Halloween, and happy Friday. | ||||||||||||||