It's all about the answers!

Ask a question

Link creation from RQM to RM is not creating backlink from RM in a Global Configuration project using OSLC API .


Swathi sheshadri (11) | asked Sep 15, 5:49 a.m.
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
Ian Barnard commented Sep 20, 9:25 a.m.
JAZZ DEVELOPER

 Backlinks aren't created when configuration management is enabled.


Swathi sheshadri commented Sep 20, 11:57 p.m.

Hello Barnard, is there a way to create backlink from DNG in gc?


Ian Barnard commented Sep 21, 3:41 a.m.
JAZZ DEVELOPER

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.

Be the first one to answer this question!


Register or to post your answer.