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

How to create a user defined attribute in RDNG RM using OSLC API?

 Hello,

I am writing a Java application to export the requirements captured in the excel sheet into RDNG using the OSLC APIs. I've managed to create new requirements in a Project and fill the data for the basic attributes. 
My problem is, say there is a user defined attribute/column in excel called EmpID of type integer. How do I create the attribute as part of these requirements? 
Based on my understanding, I will have to use Requirement.setExtendedProperties() API. Please correct me if I am wrong. But I am not able to find an example or detailed explanation on how to achieve this.
Below is the part of the code which I have executed successfully.

Requirement myRequirement = new Requirement();
myRequirement.setInstanceShape(featureInstanceShape.getAbout());
myRequirement.setTitle("Requirement 01");
String primaryText = null;
primaryText = "This requirement is created to test";
org.w3c.dom.Element obj = RmUtil.convertStringToHTML(primaryText);
myRequirement.getExtendedProperties().put(RmConstants.PROPERTY_PRIMARY_TEXT, obj);
myRequirement.setDescription("Created Through Java Client");
myRequirement.addElaboratedBy(new Link(new URI("http://www.google.com"), "Link example"));
ClientResponse creationResponse = client.createResource(requirementFactory, myRequirement,
OslcMediaType.APPLICATION_RDF_XML,
OslcMediaType.APPLICATION_RDF_XML);

Now, before I send this requirement to the server, I want to create EmpID attribute and fill it with the data.
Explanation with example or link to an example code will really help. 
Thank you.

0 votes



2 answers

Permanent link
The OSLC spec does not specify a way to modify project structure. If the attribute does not exists an OSLC consdumer will not be able to update it.

0 votes

Comments

 Thank you very much. At least now I clearly know that it is not possible, I can look for alternative solutions to achieve this. Cheers!!!


Permanent link
The ability to create user-defined types and attributes would be a very useful addition to the client extension API.

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

Question asked: Apr 01 '16, 5:17 a.m.

Question was seen: 3,731 times

Last updated: Apr 04 '16, 10:31 a.m.

Confirmation Cancel Confirm