Using RPE to hook into Primary Text of linked artifact using DNG
Hello, I am using DNG 6.0.4 and RPE 2.1.1. I need to be able to create a report that can hook into the Primary Text of the linked artifact using RPE. I infer that it requires a container to loop through the links, and also some sort of Data Source Configuration. I need specific help with this scenario. (What do I loop through in the container, which schemas to use, how to set up the javascript for the URIs in the Data Source Configuration?) We are using a tailored version of the DNG template that ships with RPE, the one that uses the module and _text schemas. Thank you, Linda Roberts |
7 answers
If you are starting from DNG_Module.dta, you can add _resources schema (that will be used for linked artifacts). For the _text schema, add a query dataSource/artifact/traceability/links/Link and dataSource/artifact/traceability/links/Link/relation should be used to configure _resources data source.
|
Links/link will return all links ("Link From", "Link To", etc.). You need to conditionally print the linked artifacts based on the link title (dataSource/artifact/traceability/links/Link/title). You may refer the sample template that prints linked artifacts for the requirements in a module. Comments
Linda Roberts
commented Apr 03 '18, 11:31 a.m.
Thanks. Can you please email me the template? I cannot access it.
Subramanya Prasad Pilar
commented Apr 03 '18, 1:46 p.m.
Linda Roberts
commented Apr 03 '18, 3:39 p.m.
Unfortunately, that doesn't work either. Can you please check from another machine?
Linda Roberts
commented Apr 05 '18, 12:45 p.m.
I don't know if I can get it from another machine or not, I'll see. However, I managed to get SOME results from recreating the template from the screenshot. I put some debug text in the loops to see what was what. I got results in the Links/link loop (but not in the Links/embedding or Links/Satisfaction loops) For the Link Title under Links/link I was able to get "Satisfied By" and "Parent Of" I got no "Satisfies" or "Embeds" or "Child Of" links that I expected to see from my modules. (Nor "Verified by" to my "My Test Case" in QM, I guess that is expected.) Underneath the _Resources configuration I was able to get the Identifier of the link and the Title of the Link. However, for Linked "Primary Text" I got <data attribute not found> Then my template blew up (got corrupted) and I need to recreate it from scratch (so I can't send it to you yet.) You can mail the corrupted template. Will see if it can be fixed, instead of you creating it from scratch.
Linda Roberts
commented Apr 09 '18, 3:50 p.m.
I managed to get a copy of the template. It has a different schema from that in the screenshot above. When I recreate the screenshot, I can get "Satisfied by" and "Parent Of" links. When I use the downloaded template that has a _resourceLinked schema, I get "Satisfies", "Child Of" and "Embeds" links. In neither case do I get primaryText, however.
showing 5 of 7
show 2 more comments
|
Finally, success! It turns out that if you want Primary Text, you have to add another container with the query on dataSource/artifact/primaryText, and then select "_value".
Also, for links in one direction (Satisfied by, Parent of), use the _resources schema. For links in the other direction (Satisfies, Child of, Embeds), use the _resourcesLinked schema in the sample template in this thread. Thanks, Linda Comments
Linda Roberts
commented Apr 11 '18, 4:54 p.m.
Rats, not success after all. I celebrated too soon. I was able to get the "_value" of Primary Text into the text container but upon publication, the results were blank. I believe creating a traceability matrix with Primary Text is critical in many different usage scenarios. It may be that the title is not the same as the Primary Text, so displaying "title" ("Name" in DNG) is not adequate.
Subramanya Prasad Pilar
commented Apr 11 '18, 10:41 p.m.
The template in this thread only prints the title of linked artifacts. I will provide a modified template that also prints the primary text for linked artifacts.
|
Hi Linda,
Comments
Linda Roberts
commented May 16 '18, 1:53 p.m.
Thanks Prasad! I can't wait till I can get to an environment where I can download this. I ended up with a solution as well, and am curious how it compares.
Linda Roberts
commented May 21 '18, 6:31 p.m.
Ah, so your trick for getting Primary Text to be accessible included appending to the javascript for the Dynamic Configuration, i.e. relation.replace("/resources","/publish/resources?resourceURI=") + "&ptext=true" Your template did not work the first time I tested it, but after moving things around inside containers and such, I got it to work. Thanks! My own solution was much more complex. Using + "&ptext=true" simplifies things a lot.
Subramanya Prasad Pilar
commented May 23 '18, 11:34 a.m.
Good to know that you got it working. If you are referring to the sample template, please make sure that you are using modules URI to configure the data source in the following format:
|
Hello Prasad,
is it possible you upload the updated template to another platform or send it to me via mail?
Regards,
Markus
Comments
Subramanya Prasad Pilar
commented Jul 12 '19, 12:08 p.m.
I have uploaded it in Google Drive as well as IBM box. I can mail it in case you cannot access the file.
|
Hello Prasad,
I managed downloading the file from google.
Thanks.
Unfortunately it seems this template can only deal with "module" links.
I use also "folder" links but those are not displayed in the ouput file.
Is there a possibility to implemtent this inside the template?
Regards,
Markus
|
It took me a long time to figure this one out, though now it seems obvious! (I was in classic DOORS frame of mind then.) Module links are based on the "about" URI and folder links are based on the "core" URI. So, when you do the dynamic configuration for folder links, for the _text schema you need to use "core" using the following arcane incantation, selecting both "about" and "core" in the proper location (dataSource/artifact/moduleContext/contextBinding)
var uri = about var pos = about.indexOf("/rm/reources"); if (pos>=0) { uri = about.substring(0,pos); uri = uri+ "/rm/publish/text?resourceURI=" + core; } uri;.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Thanks. I'm making some progress on this, though I have not completely succeeded yet!. I know I made it to the new part of the template because I got an error about they typo I made in the javascript that resulted in "//"..... (LOL)
After correcting that error and all the other errors I made along the way I finally got no errors but no results either. Does the Links/link go in both directions?
Hello
Hello Linda
I cannot really send you the template, but I think you need to move your condition to the container that is AFTER the datasource _resourcelinked.