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

How to get the allowed values for the Enumeration List(multiple checkbox)

 Hi,


Please let me know, How to get the allowed values for the Enumeration List(multiple checkbox)?


Donald Nongcommented Jun 06, 3:28 a.m.

No, you will not get <oslc:allowedValues>. Instead, you should get <oslc:range>, which is missing in your output above, for some reason. If you can get the <oslc:range> attribute, and access the resource URI within it, you will get all the allowed enumeration values. 


I'm able to get the below range form the URL: https://localhost:9443/ccm/oslc/enumerations/_GFWMAHjbEee7Pug-3D3SBA/enumerationList$Variant_ID/ ,but not sure how to get the allowed values from therange.Please help me on that.


<oslc_cm:Collection oslc_cm:totalCount="7">






</rtc_cm:Literal>
</oslc_cm:Collection>

Tha java OSLC code used is 


Property vehicle_typeProperty1 = shape.getProperty(new URI("http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"+"vehicle_variant_defect"));
if(null !=vehicle_typeProperty1) {
URI[] allowedValuesRef4=vehicle_typeProperty1.getRange();
ClientResponse allowedValuesResponse9= client.getResource(allowedValuesRef20.toString(),OslcMediaType.APPLICATION_XML);
AllowedValues allowedValues9 = allowedValuesResponse9.getEntity(AllowedValues.class);
Object[] values9 = allowedValues9.getValues().toArray();
defect1.getExtendedProperties().put(new QName("http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/","vehicle_variant_defect", "rtc_ext"), (URI) values9[2]);
defect1.getExtendedProperties().put(new QName("http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/","vehicle_variant_defect", "rtc_ext"), (URI) values9[1]);
}
}


Thanks,
Sujith Babu

0 votes



One answer

Permanent link

Not sure if it's too late to answer. Since the type is "enumeration list", the allowed value is any combination of the values in the "range". In your example,  a combination of 1 to 7 out of the 7 values would be valid.

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,927

Question asked: Sep 27 '17, 5:31 a.m.

Question was seen: 1,575 times

Last updated: Oct 17 '17, 2:02 a.m.

Confirmation Cancel Confirm