Link creation from RQM to RM is not creating backlink from RM in a Global Configuration project using OSLC API . The snippet was working as expected 2 weeks back. The snippet used is below: Can you please support us.
jar used : oslc-java-client.2.3.0
ClientResponse rqmResponse = null;
boolean flag = false;
try {
TestCase testCaseofID = getTestCaseForGC(testcaseID);
String testCaseURI = testcaseID;
Link newLink = new Link(new URI(artifactURI));
Link[] validateRequriement = testCaseofID.getValidatesRequirements();
if (!Arrays.asList(validateRequriement).contains(artifactURI)) {
Link[] allValidatesLink = new Link[validateRequriement.length + 1];
int i = 0;
for (Link dngLink : validateRequriement) {
allValidatesLink[i++] = dngLink;
}
allValidatesLink[i] = newLink;
testCaseofID.setValidatesRequirements(allValidatesLink);
// Updating test case
rqmResponse = client.updateResource(testCaseURI, testCaseofID, OslcMediaType.APPLICATION_RDF_XML);
if (rqmResponse.getStatusCode() == 200) {
logger.info("Successfully added requirement link for " + testcaseID);
flag = true;
}
} else {
logger.info("Testcase : " + testcaseID + " is linked to artifact " + artifactURI);
flag = true;
}
} catch (NullPointerException e) {
logger.error("Error Occured in creating requirement link! Please check. Status Code : "
+ rqmResponse.getStatusCode() + " : " + e.getMessage());
flag = false;
} catch (Exception e) {
logger.error("Error Occured in creating requirement link! Please check. Status Code : "
+ rqmResponse.getStatusCode() + " : " + e.getMessage());
flag = false;
} finally {
rqmResponse.consumeContent();
}
return flag;
Comments
Backlinks aren't created when configuration management is enabled.
Hello Barnard, is there a way to create backlink from DNG in gc?
No - backlinks are intentionally not created/used. When you create the forward link the browser UI will show you a "backlink" but that is dynamically calculated for presentation/usage purposes rather than (as before configuration management was enabled) being actually stored as an actual backlink.