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
8 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.
Set URI to Script Expression
relation.replace("/resources/","/publish/resources?resourceURI=")
From _resources data source, you can print the primary text (in the screen shot, I am printing title).
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
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
Hi Linda,
You can refer this updated template. You just need to append ptext=true to the URI so that you can print primary text (dataSource/artifact/primaryText).
Regards,
Prasad
Comments
1 vote
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;.
Hi, Following on the discussion in this thread. Im using the provided template to pull the linked artifacts data. I was able to print the 'Title' and 'primaryText' however we have images as well in the traced artifact, which doesn't seems to be populated with text. I've tried wrappedresourceImageURI, content etc but nothing worked.
Comments
Linda Roberts
Apr 02 '18, 6:27 p.m.Anjuri Kelaiya
Oct 17 '19, 4:33 a.m.Linda Roberts
Oct 17 '19, 12:16 p.m.Anjuri Kelaiya
Oct 18 '19, 2:49 a.m.Linda Roberts
Oct 18 '19, 6:52 p.m.