Source Message classes

Manufacturing Data Engine (MDE) lets you transform a series of source messages into records of a specific type by means of parsing.

Source message classes are configuration entities that represent the source of the parsing operation, and describe a set of structurally and semantically similar source messages.

source-to-target

Source message classes provide a predictable message schema to parsers so that transformations, mappings and data extraction can be performed on known fields.

Source message classification

Each message class has an associated message class expression and a priority. The priority of a message class is an integer from 0 to 65535 , inclusive. Lower integers indicate higher priorities.

A source message is associated to a source message class when the first source message class expression evaluates to true after the classes are sorted on priority.

Source message class expressions are written in Spring Expression Language (SpEL).

source-message-class

SpEL expressions can access source message attributes (Pub/Sub attributes) and data. The message attributes are exposed under the #root.headers key, and data is exposed under the #root.event key.

The following are examples of SpEL expressions for a source message class:

#root.event['MessageType'] != null && #root.event['MessageType'] matches 'Sensor.*'
#root.headers['source'] != null && #root.headers['source'] == 'MCe'

Naming restrictions for Message Classes

A Message Class name can contain the following:

  • Letters (uppercase and lowercase), numbers and the special characters - and _.
  • Can be up to 255 characters long.

You can use the following regular expression for validation: ^[a-z][a-z0-9\\-_]{1,255}$

If you try to create an entity violating the naming restrictions you will get a 400 error.