Skip to main content

Manage Mappers

A mapper defines how messages are transformed from one type to another.
When creating a new mapper in 1Gateway, you define the input and output message types, general behavior, and optional parameters such as filters or history tracking.


Creating a New Mapper

In the Mapper List view, click + Add Mapper.

Add Mapper Screenshot

After naming the mapper, the Mapper Definition screen opens.

Mapper Definition Fields

The Mapper Definition screen defines how the mapper processes messages and which transformations it performs.

Mapper settings

FieldSupported valuesDescription
NameTextThe name of the mapper, set during creation.
FromTextThe input message type the mapper will receive.
ToTextThe output message type the mapper will produce.
Mapper descriptionTextOptional short note describing the mapper’s purpose. Helpful for documentation and version tracking.
FilterGroovy expressionDefines when the mapper applies. If the Groovy expression evaluates to true, the mapper runs; otherwise, the message passes through unchanged.
Include historytrue / falseEnables message version tracking. When active, a branch is added to the message showing previous versions and changes.
Target key for historyKeyThe message path where history information is stored when history is enabled.
note

These settings can be adjusted at any point by clicking on the desired mapper and then on the Settings button:
Settings button

Filter Example

Use filters to make a mapper apply only to specific message conditions.
For instance, this filter runs the mapper only for high-priority incidents:

msg.type == "incident" && msg.priority == "high"

If the condition is not met, the message is ignored by this mapper and continues unmodified.

Message history

Message history can be activated by going to a mapper settings and clicking Include History. The "Target key for history" defines where the version data is added within the message structure.

The message will include a history key with the changes made to the message since the last update. Messages are identified by the origin/key field in the message, which is used to keep track of message changes.

The history key consists of four sections:

  • Previous: previous instance of this message
  • Deleted: what fields in the message have been deleted since the previous update.
  • Updated: what fields in the message have been updated since the previous update.
  • Inserted: what fields in the message have been inserted since the previous update.

Example of Message with History Tracking

message with history