How to create a user defined attribute in RDNG RM using OSLC API?
Hello,
Now, before I send this requirement to the server, I want to create EmpID attribute and fill it with the data.
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.