Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

1

0 votes

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 


I have downloaded the  uploaded template DNGModuleReqsWithLinks_SP.  By using that template, I am able to get "Satisfies", "Link from" but I am not able to get the link type "Embeds".
How can I get artifacts linked with the link type "Embeds"?
 
Thanks,
Anjuri

Edit the condition on the container (datasource/artifacts right after the datasource configuration to switch to links) to:
title = "Embeds"
where title comes from the ...traceability//links/Link context

 Hello Linda


Thanks for your response.  I tried the same thing as provided in the sample template. 
Used _resources data source schema, set query as datasource/artifact/traceability/links/link, set condition as, title == "Embeds" right after it. then set datasource _resourcelinked same as the sample template. but in any case, it is not providing me data for the Embeds link. 
is there any different configuration required for the link type "Embeds"? If it's working for you properly, could you please provide me your .dta file with the "Embeds" link type?

 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.



7 answers

Permanent link

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).

1 vote


Permanent link

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.

0 votes

Comments

Thanks. Can you please email me the template? I cannot access it.

Unfortunately, that doesn't work either.

Can you please check from another machine?
Thanks,
Prasad (subra.prasad@gmail.com)

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.

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

Permanent link

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

0 votes

Comments

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.

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.


Permanent link

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

0 votes

Comments

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.

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.

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:
https://<server>:<port>/rm/publish/modules?resourceURI=_c5733113b7694e81b68d23bb6f43e8d0


Permanent link
Hello Prasad,

is it possible you upload the updated template to another platform or send it to me via mail?

Regards,
Markus

0 votes

Comments

I have uploaded it in Google Drive as well as IBM box. I can mail it in case you cannot access the file.


Permanent link

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

0 votes


Permanent link

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;.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Apr 02 '18, 12:45 p.m.

Question was seen: 6,922 times

Last updated: Oct 18 '19, 6:52 p.m.

Confirmation Cancel Confirm