It's all about the answers!

Ask a question

Why is json "truncated" for enumerations if externalValue="" ?

Kevin Ramer (4.5k8178197) | asked Nov 18 '13, 3:24 p.m.
edited Nov 18 '13, 7:28 p.m. by Millard Ellingsworth (2.5k12431)
I spent some time this morning trying to figure out why an OSLC library I use began complaining about a null result on some  enumeration literal or another.   I figured out "why" but would like to understand why the json output will NOT contain literals which have externalValue="" on their definition ?  [  I guess because they could not be distinguished from one another,otherwise ]

That is, if say priority has the following:

<enumeration attributeTypeId="priority">
                    <literal default="true" externalValue="" icon="processattachment:/enumeration/unassigned.gif" id="priority.literal.l01" name="Unassigned"/>
                    <literal externalValue="" icon="processattachment:/enumeration/low.gif" id="priority.literal.l02" name="Low"/>
                    <literal externalValue="" icon="processattachment:/enumeration/medium.gif" id="priority.literal.l07" name="Medium"/>
                    <literal externalValue="" icon="processattachment:/enumeration/high.gif" id="priority.literal.l11" name="High"/>

Doing a REST call to get it (https://server:port/CONTEXT/oslc/enumerations/PROJECT_UUID/priority.json  gives this:

           "rdf:resource": "https://server:port/CONTEXT/oslc/enumerations/PROJECT_UUID/priority/priority.literal.l01",
           "dc:title": "Unassigned"

I have worked around this by setting the externalValue == id.     Is removing the externalValue="" also an acceptable course ?

I followed the above trail thanks to

RTC 4.0.3

2 answers

permanent link
Bryan Miller - Integration Developer (4493531) | answered Nov 19 '13, 1:58 p.m.
edited Nov 19 '13, 2:57 p.m.

We should collaborate on submitting a work item for this.   It appears that there is a bookkeeping issue that OSLC cannot resolve.

BTW, this is not isolated to JSON.  We tried it with XML, etc and the data medium appears not to matter.  It is an OSLC/REST issue.


Kevin Ramer commented Nov 19 '13, 2:09 p.m.

Done.   290470 in RTC

permanent link
Shawn Maclaga (1963) | answered Nov 21 '13, 11:44 a.m.
When creating a new project area, the externalValue entries are not present on the enumeration definition.
Adding externalValue="" to all the enumeration entries for priority causes the problem you've described to appear for both 4.0.3 and 4.0.6 M1.
Removing externalValue="" from all the enumeration entries for priority allows all of the enumerations to be returned instead of just one for both 4.0.3 and 4.0.6 M1.


Kevin Ramer commented Nov 21 '13, 11:47 a.m.

As does giving externalValue a value.

Your answer

Register or to post your answer.