question

Upvotes
Accepted
9.6k 10 7 7

EMA Webinar Nov 2: How can we convert Enum data?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apijava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
9.6k 10 7 7

EMA Java does not provide interface to get decoded enum value. EMA Java keeps the dictionaries (RDMFieldDictionary and enumtype.def) internally. However, EMA Java is open source so you can modify it to get decoded enum value according to the enum dictionary it has loaded. The example source code to modify EMA Java for converting enum can be found in https://community.developers.refinitiv.com/questions/6595/decoding-fieldlist-contents-with-field-and-enumera.html

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1.5k 5 6 7

Hi there,

One more thing. The word "enum" implies some type of uniqueness to most developers. This is a trap when talking about OMM Enums.

Consider the following OMM Enum which is the one used by field RDN_EXCHID (Fid 4):

..   ...    ....
 4  "CIN"   National Stock Exchange
 5  "PSE"   NYSE Arca
 6  "XPH"   NASDAQ OMX PSX when trading in SIAC
 7  "THM"   NASDAQ InterMarket
 8  "MID"   Chicago Stock Exchange
 9  "NYQ"   Consolidated Issue, listed by NYSE
10  "TOR"   Toronto Stock Exchange
11  "MON"   Montreal Stock Exchange
12  "TSX"   TSX Venture Exchange
13  "DEX"   Direct Edge Holdings - EDGX (CTA)
14  "AOE"   American Options Exchange
..   ...    ....


The first column, the integer value, is what travels the wire. The second column is the translation of the enum. It is what you would display to an end-user. The last column is a description. It typically cannot be retrieved from any of the TR APIs.

Here's the trap: Do not assume that the second column is unique. It is not. The only thing which is unique is the integer value. In other words. If you want to display something which is truly unique to the end-user then you'll have no other option than to display to him the integer value (which will mean nothing to him) or (perhaps better) instead display some form of concatenation of the integer value plus the short name.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.