It's all about the answers!

Ask a question

RTC 6, OSLC, how to create WI with enumerations using getExtendedProperties().put(new QName..

Rafael Rodriguez Montes (23013126247) | asked Oct 10 '16, 7:11 p.m.
I'm developing a java client for create WI using OSLC and lyo and I'm passing the values through getExtendedProperties().put(new QName, but for the case that I need to specify values of attributes that are part of enumeration, it doesn't work, so I would like to know the use of getExtendedProperties().put(new QName for enumerations and literals or values of this types of attributes?

One answer

permanent link
Sujith Babu Bandla (265) | answered Sep 04 '17, 8:54 a.m.

Hi Rafael,

Please try to implement similarly,so that you can fill the enumeration attribute.

//Look at the allowed values for Priority. This is generally a required field for defects.
Property PriorityProperty = shape.getProperty(new URI(""+"vehicle_build_phase_new"));
if(null !=PriorityProperty) {
URI allowedValuesRef2=PriorityProperty.getAllowedValuesRef();
ClientResponse allowedValuesResponse2= client.getResource(allowedValuesRef2.toString(),OslcMediaType.APPLICATION_XML);
AllowedValues allowedValues2 = allowedValuesResponse2.getEntity(AllowedValues.class);
Object[] values2 = allowedValues2.getValues().toArray();
defect1.getExtendedProperties().put(new QName("","vehicle_build_phase_new", "rtc_ext"), (URI) values2[1]);

Sujith Babu

Your answer

Register or 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.