DNG RPE How do you publish the text value of an enumeration?
When publishing enumerated attribute data from DNG using RPE the values come out as integer indexes.
Say there is an enumerated attribute Priority
It will have enumerations
0 - High
1 - Medium
2 - Low
Each enumeration value has an integer and a string value.
The 'value' extraction in the DNG Text schema using:-
dataSource/artifact/collaboration/attributes/objectType/customAttribute/value
returns the value '0' instead of the value "High"
How do you get the value 'High' ?
There is also a TS node:-
dataSource/artifact/collaboration/attributes/objectType/customAttribute/valueTS
but that does not return anything in my experimentation
4 answers
Hello Sean,
This is how I did it; not elegant, but it works for me. "Priority Attr" is a custom attribute
if (name == "Priority Attr")
{
switch (Number(value))
{
case 0:
"[Essential]"
break;
case 1:
"[Future]"
break;
case 2:
"[Desirable]"
break;
case 3:
"[Removed]"
break;
case 4:
"[NA]"
break;
default:
"[CHANGEME]"
break;
}
}
Comments
Kumaraswamy Gowda
Apr 16 '18, 11:56 a.m.I couldn't find much information at DNG Rest API wiki.
https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI
Sean F
Apr 16 '18, 12:40 p.m.Thanks for having a look anyway Kumar