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

How to add "SatisfiedBy/satisfies" link in DNG workitem through OSLC API?

Hi All,

I am working on task where I have to update DNG artifact with link("SatisfiedBy/satisfies"). I am using OSLG4j(OSLC client) for developing my stand alone application. I am able to add link of type "SpecifiedBy/Specifies" in DNG artifact through my code, but not able to add "SatisfiedBy/satisfies" link.

Sample code

Requirement req = response.getEntity(Requirement.class);
String etag = response.getHeaders().getFirst(OSLCConstants.ETAG);
ClientResponse updateResponse = null;
                        req.addSatisfiedBy(new Link(new URI(artifact.getKey()), artifact.getValue()));
                        updateResponse = client.updateResource(resultsUrl, req, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML, etag);
                        if(updateResponse.getStatusCode() ==HttpStatus.SC_OK) {
                            System.out.println("Requirement updated successfully with requirement : " + artifact.getValue());
                        } else {
                            System.out.println("Issue while updating requirement..............." +  artifact.getValue());
                        }

When I run this code I am getting response 200 but unable to see link in Doors artifact. Is there any linitation on adding by OSLC rest api?
        
          
Could you please let me know how to achieve same?

Thank you in advance

0 votes

Comments

Hi nitesh, 


did you find an answer to this problem.

Please let me know, i am stuck at same issue.

Thanks
vaibhav 



One answer

Permanent link
No such problem in my RDNG 5.0.2 environment. It should be quite simple as to add a <rm_property> attribute to the artifact presentation and update it with a PUT operation. I suggest you double check the instance shape of the artifact and make sure you are using the correct UUID for the Satisfaction link type.

0 votes

Comments

Hi I am trying to create links in artifact trough OSLC api, but seems no luck, Unable to see satisfies link in artifact though I am getting response as 200 for update operation,

However I am able to add Specifies link through api. I am using below code to create links.
Requirement req = response.getEntity(Requirement.class);
req.addSatisfies(new Link(new URI(XXX), XXX)); // req.addSatisfies(new Link(new URI(XXX), XXX));(works prefect)
response = client.updateResource(resultsUrl, req, OslcMediaType.APPLICATION_RDF_XML,  OslcMediaType.APPLICATION_RDF_XML, etag);

This is how I have configured links in Project management properties(Note this are manually created links of type Satisfies /Satisfied By

Satisfies    Satisfied By / Satisfies    http://open-services.net/ns/rm#satisfies   
Satisfied By    Satisfies / Satisfied By    http://open-services.net/ns/rm#satisfiedBy

Thank you in advance
  

 Have you checked the instance shape of the artifact as I suggested? GET an RDF+XML presentation of the artifact first, and take note of the <oslc:instanceShape> attribute. Then GET the instance shape, and you should see something like this

<oslc:Property>
<oslc:name>_05YjMYPsEeSfUbpncKGSsw</oslc:name>
<oslc:propertyDefinition rdf:resource="https://clm502/rm/types/_05YjMYPsEeSfUbpncKGSsw" />
<oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" />
<oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" />
<dc:description rdf:parseType="Literal" />
<oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" />
<dc:title rdf:parseType="Literal">Satisfaction</dc:title>;
</oslc:Property>

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
× 10,938

Question asked: Apr 09 '15, 10:51 a.m.

Question was seen: 5,581 times

Last updated: May 17 '21, 1:38 p.m.

Confirmation Cancel Confirm