How Do I Write an RM OSLC Query to Fetch Artifacts in Module by GUID and Identifier
This question may warrant some background explanation.
We are developing an RPE report to publish our modules to Word. One of the things we'd like to be able to do is convert an exported hyperlink to a Word cross reference instead (provided that the hyperlink points to an area within the same document that is being exported. For example, if a link points to another artifact in the same module). Our first instinct for doing this was to export the URI of the artifacts. The hyperlink contains the URI that the link points to so we had hoped to be able to match up hyperlinks with artifacts in post-processing.
Unfortunately, an artifact may have more than one URI. The hyperlink points to the module-context-independent URI, but the view that we are exporting includes the Module-Context URI. As a result, the URIs don't match.
We aren't ready to give up on the idea just yet and are thinking that the next step would be to execute an RM OSLC query that will fetch a list of all artifacts within the module and return those artifact's IDs and URIs so that we can create a mapping or lookup table.
I've been trying to get the OSLC query formulated for RM, but it doesn't appear to be working. I've followed the guidelines outlined in Using OSLC capabilities in the Requirements Management application without success. I was able to successfully discover the project area's query base URL, but appending the example queries from the aforementioned article to my base URI produces an error about an unrecognized or unexpected character or something along those lines. I've done various experiments with URL encoding different characters hoping that was the issue, but haven't had any luck. I've successfully queried RTC on the CCM side using OSLC queries, but I don't seem to be able to do the same thing on the RM side.
Note that none of this would be necessary if the XML schema that we are exporting in RPE included the module-agnostic URI for the artifacts rather than the module-context-dependent URI, but we don't think we have a choice where that XML schema is concerned. We initially tried to export our modules by iterating through the module one artifact at a time and fetching the necessary report data, but doing it that way exhibits prohibitively bad performance. The report may run for hours and that's on a relatively small module. Instead, we use the "views" resource that is used in one of the built-in reports (Print Module Table or something like that). That resource doesn't seem to be documented (although I note that "views" is part of the OSLC query base).
If there is an alternative to what we are trying to do other than the direction this question has headed, we'd appreciate hearing those alternatives as well.
One answer
https://jazz.net/forum/questions/136269/rrcrpe-how-to-get-the-uri-of-the-base-artifact-when-the-artifact-is-included-in-a-module
So now with RM 5.0, the "modules" view (I have not checked others) will produce something like below, where <rrm:about> is the URI for the module/binding artifact, and <rrm:core> is the UUID for the corresponding base/core artifact. The "views" view does not seem to have the <rrm:core> attribute though.
<rrm:contextBinding>
<rrm:about>
https://clm5:9443/rm/resources/_c078dfe18a5448528e6d2a20b41db51f
</rrm:about>
<rrm:identifier>253</rrm:identifier>
<rrm:title>The purpose of writing Use Case</rrm:title>
<rrm:format>Text</rrm:format>
<rrm:core>_d233253031154a09a9c2dd801d2291a0</rrm:core>
<rrm:moduleUrl>
https://clm5:9443/rm/resources/_473aa3611bec42939389c413388bdb46
</rrm:moduleUrl>
<rrm:parentBindingUrl>
https://clm5:9443/rm/resources/_4f20de0c838c49288d149738c55f8243
</rrm:parentBindingUrl>
<rrm:section>1.1.0-1</rrm:section>
<rrm:bookOrder>3</rrm:bookOrder>
<rrm:depth>3</rrm:depth>
<rrm:isHeading>false</rrm:isHeading>
</rrm:contextBinding>
Comments
Donald, what if I need to go the other direction? From the base/core artifact to the module instance of the artifact?
Bob - please create a new question .
Comments
Gabriel Ruelas
Jun 16 '14, 1:58 p.m.Hi, Which RM Version are you using ?
Nate Decker
Jun 16 '14, 2:17 p.m.We are using RM 4.0.6