Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Open Message Format (OMF)

Enum types (Schema definitions)

  • Last UpdatedAug 19, 2026
  • 2 minute read

OMF 2.0 supports enumerations as reusable schema types defined within Schema messages. Enum types define a fixed set of named values and are intended to be referenced by other types using reftypeid.

Enum types define a fixed list of allowed values. They are not used directly in data messages, but are referenced by other types to restrict the values of a property.

Properties that reference an enum use reftypeid to associate the property with the enum definition. An enum type is referenced when:

  • The property value in Instance messages uses one of the enum’s defined names or values, depending on destination system behavior.

  • Interpretation and validation of enum values are handled by the destination system.

  • OMF does not enforce enum semantics beyond schema definition.

Enum Type Properties

The following keywords are used to define enum type definition. If a keyword is not specified the default will be used.

Name

Description

type

Optional type of the enum. The only currently supported type is integer.

format

Optional format for the storage type. Supported values are int16 or int32.

values

Required list of allowed enum values, each defined by a name and associated value.

Enum values collection keywords

The enum value collection is used only when defining an enum type in a Schema message. Enum values are not sent as instance data.

Name

Description

name

Required unique string that describes the condition or state being represented. Some destination systems may use this name when presenting enum values, depending on how the enum is interpreted.

value

Required unique integer value associated with the enum. This value must be compatible with the enum’s defined storage format.

In this example we have a Valve with 2 states, CLOSED or OPEN and accept the defaults, or explicitly define the values. The following Type messages are valid syntax:

{

"types": [

{

"id": "ValveState",

"enum": {

"values": [

{

"name":"CLOSED",

"value":0

},

{

"name":"OPEN",

"value":1 } ]

}

}

}

}

{

"id": "ValveState",

"enum": {

"values":[

{

"value":0,

"name":"CLOSED"

},

{

"value":1,

"name":"OPEN"

}

]

}

]

}

"id": "ValveState",

"enum": {

"type": "integer",

"format": "int16",

"values":[

{

"value":0,

"name":"CLOSED"

},

{

"value":1,

"name":"OPEN"

}

]

}

}

}

}

Enum Type Messages for Data Quality

Enum types may be used to represent data quality states by defining a reusable schema type that identifies allowed quality values. These enums are referenced by streaming data properties through a quality schema, rather than through special property flags.

To associate an enum with quality values for a streaming data property, define a quality schema and reference it using the qualityschema property. For example:

{

"types": [

{

"id": "DeviceStatusEnum",

"enum": {

"type": "integer",

"format": "int16",

"values": [

{"name": "DeviceConnected","value": 0 },

{"name": "DeviceFailure","value": 1 },

{"name": "CommunicationFailure","value": 2 },

{"name": "UncertainOutOfLimits","value": 3 }

]

}

},

{

"id": "TankMeasurement",

"classification": "streamingdata",

"type": "object",

"properties": {

"Timestamp": {

"type": "string",

"format": "date-time",

"isindex": true

},

"Pressure": {

"type": "number"

},

"Temperature": {

"type": "number"

}

"DeviceStatus": {

"reftypeid": "DeviceStatusEnum"

"qualityschema": "<customQualitySchemaName>"

}

}

]

}

]

In This Topic
Related Links