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

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

0 votes

Comments

I couldn't find much information at DNG Rest API wiki.
https://jazz.net/wiki/bin/view/Main/DNGReportableRestAPI

Thanks for having a look anyway Kumar



4 answers

Permanent link

 We use literal name instead of value and it prints out the text instead of the number. 

2 votes


Permanent link
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;
                }
   
}

0 votes


Permanent link
^^Thanks for the reply Matt. I was worried it was going to be something complicated like that.

^Thanks Vanessa. That looks like a nice simple solution. I will give that a try.

0 votes


Permanent link
Vanessa's method works well, much neater and lower maintenance than  the Case statement.

Thanks!

PS: Note is does NOT display text in the RPE 606 preview; but then again, neither does my method. For me, it only works for a full document generation.

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
× 12,017

Question asked: Apr 16 '18, 11:39 a.m.

Question was seen: 3,601 times

Last updated: Jun 24 '18, 8:33 p.m.

Confirmation Cancel Confirm