Klevr Product Documentation logo

Transform Merge Stage

The Transform Merge stage allows two or more messages from the history of an integration run to be merged together into a single payload.

Stage Overview

The Transform Merge stage allows two or more messages from the history of an integration run to be merged together into a single payload.

Stage Definition File Location

All Transform Merge stages are defined by creating an appropriately formatted JSON definition file in the following location:

interfaces
{businessUnitCode}
{domainCode}
{integrationName}
tr
merge
{STAGE_NAME}.json

Stage JSON Definition File Format

The JSON definition file for a Transform Merge stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "source": "source-event",
  "concurrency": 10,
  "mergeInterfaces": [
    "previous-stage-1",
    "previous-stage-2",
    "previous-stage-3"
  ],
  "interface": "previous-stage-1",
  "preLogTransformSchemaFileName": "schemas/path/to/schema/schema-name.liquid",
  "preLogTransformSchemaType": "liquid|javascript",
  "preLogTransformFormat": "json|xml|csv"
}
PropertyDescription
nameThe name of the stage.
displayNameOptional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability.
descriptionOptional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature.
enabledOptional boolean flag (true or false). The default is true.

Generally set via a DevOps variable. Controls if the stage is deployed enabled or not.
sourceThe source event that the stage subscribes to. See Pub/Sub Model.

Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to.
concurrencyOptional number of concurrent runs permitted for the stage. Default is 10.
mergeInterfacesOptional, but either mergeInterfaces or interface is required. When set, the array defines two or more stages that must have previously been executed in the run history of the overall integration, with the stages' exported payload details being present in the triggering event's Attributes section. The stage will merge and output the payloads from these stages.
interfaceOptional, but either mergeInterfaces or interface is required. When set, the stage will only output the payload from the selected stage. It is important to note that the output will not be converted into an array in this instance.

Pre-Logging Transformation

This stage supports the optional pre-logging transformation feature using the following fields:

  • preLogTransformSchemaFileName
  • preLogTransformSchemaType
  • preLogTransformFormat

See the Pre-Logging Transformation for details.

Output Format

The stage will produce a message in the following format if mergeInterfaces is used:

[
  {
    // previous-stage-1 message
  },
  {
    // previous-stage-2 message
  },
  {
    // previous-stage-3 message
  }
]

The stage will produce a message in the following format if interface is used:

{
  // previous-stage-1 message
}

Last updated on