It's all about the answers!

Ask a question

How can I get allowed values for an RTC enumeration list attribute using web APIs

Myles F (145) | asked Feb 23 '15, 6:32 p.m.
edited Feb 24 '15, 3:47 a.m. by Ralph Schoon (61.2k33643)
I have an 'Enumeration list' (multiple selection) field, but I cannot get the enumeration values for it.

When I get the resource shape, the field looks like:

<rdf:Description rdf:about="https://my.rtc:9443/ccm/oslc/context/_0u1_QV7hEeSPi_AaoZ4IKA/shapes/workitems/task/property/customMultiSelect">
        <rdf:type rdf:resource=""/>
        <oslc:valueType rdf:resource=""/>
        <oslc:representation rdf:resource=""/>
        <oslc:readOnly rdf:datatype="">false</oslc:readOnly>
        <oslc:propertyDefinition rdf:resource=""/>
        <oslc:occurs rdf:resource=""/>
        <oslc:name rdf:datatype="">customMultiSelect</oslc:name>
        <dcterms:title rdf:parseType="Literal">Custom Multi Select</dcterms:title>

Enumeration fields (single selection) also have an <oslc:allowedValues> element, that provides an enumeration that can be looked up, but enumeration lists don't seem to have this.

If I retrieve a work item, the field doesn't show up unless it has a value set, so I can't get the possible enumerations from that either. 

How can I get the options for my attribute?


One answer

permanent link
F R (132) | answered Feb 10 '17, 6:44 a.m.

You can get the full definition of the enumerated values using GET on the property definition. There you can get the full mapping between the numerical values (rdf:value) and the string labels (rdfs:label).

Your answer

Register or to post your answer.