Message Transformation Application

You can use Message Transformation applications to transform messages for additional processing or to match the expected format.

Setting Message Transformation Properties

Apart from the common properties, the following property tabs are provided for a Message Transformation application:


Figure: Properties - Message Transformation Application

Parameters

Arbitrary set of Input and Output Parameters can be created. Accordingly the data mapping should be done.

Configuration

In the Configuration tab view, you can configure data mappings using the input parameters. By default, the input access point is added to the source message and the output access point to the Target message.


Figure: Configuration

Testing the Message Transformation Application

Test - Click the Test tab. You can test the mapping of the messages using this option.

Filter Field Options

All filters except the text filter can be switched on and off with icon select buttons grouped above the tree views for input and output messages. The filter buttons support the selection of:

Text Filter

The text filter text box for source and target messages as a text entry field is displayed at the right of the other filter buttons.

The text filter allows entering space-separated filter strings. Entering filter strings initiates a case-insensitive OR-filtering of the names of all fields in all source or target messages for the containment of the specified strings. For example, when entering "hello world", there will be a filter for the words "hello" and "world". Every change in the filter string entry except adding leading or trailing spaces initiates a new filtering. The retrieved fields are displayed and if necessary, tree nodes are expanded. All other field tree nodes are omitted. The scrollbar of the tree is scrolled to the first retrieved entry. The retrieved fields are neither highlighted nor selected. The message names themselves are not filtered. The top level tree nodes representing messages are always kept visible.


Figure: Text Filter

Display only highlighted fields

To display only all highlighted fields, click the Display only highlighted fields icon.

Only fields that are highlighted are now visible in the message pane.


Figure: Display only highlighted fields

To display highlighted and non-highlighted fields again, click the grey bulb icon.

Display only fields with mapping expressions

Click the icon to display only the fields which have mapping expressions. Note that this icon is available only for the target message.


Figure: Fields with Mapping Expressions

Display only fields with no mapping expressions

Click the icon to display only the fields which have no mapping expressions. Note that this icon is available only for the target message.


Figure: Fields with No Mapping Expressions

Display only fields whose mapping expression is invalid

Click the following icon to display only the fields whose mapping expression is invalid. This icon is displayed only for the target message.


Figure: Display Invalid Mapping Expressions only

Creating Mapping Expressions

You can drag and drop a single source element on a target element. A 1:1 mapping expression gets created in the Mapping column. If the types do not map a type conversion is introduced. If you select the row in the Target Message, the mapping expression is displayed in the Expression Mapping section.


Figure: Single Source Field Mapping Expressions

If a complex source field is dragged and dropped on a complex target field, all fields in the complex source field are mapped to fields in the target field whose names are equal or similar to the names of the source fields.


Figure: Complex Field Mapping

JavaScript Editor

Every mapping is performed as the evaluation of a JavaScript expression with preceding supporting statements or function definitions. The mapping expression contains a single expression which describes the content of the corresponding field in the output message for which the mapping is defined. The mapping expression can be interpreted as an assignment, for example:

<output message field> = <user-defined function>(<input message field>) +
        <JavaScript function>(<input message field>);

The JavaScript editor provides the following features:

Dragging and Dropping Source Elements to the JavaScript Editor

You can drag and drop source elements to the JavaScript editor.

Dragging and dropping a source element to the JS Editor
Figure: Dragging and dropping a source element to the JS Editor

Basic Mapping

Basic mapping expressions can be created by dragging and dropping data from the Source Message section to the Target Message section. You can edit the basic mapping expression in the JavaScript editor. For example:


Figure: Basic Mapping

The message field name of the selected target message is added automatically on top of the mapping field. The value of the expression is returned to that message after evaluation.

Advanced Mapping Expression

You can enter more complex JavaScript code in the editor, if you select the Advanced Mapping checkbox. In that case you need to assign the resulting value to the corresponding out parameter in the code, as in the following simple example:


Figure: Example - Advanced Mapping example

Syntax Highlighting

The editor highlights keywords and variables in different colors.

Auto Indentation

The JavaScript editor supports auto indentation as you go on adding the code.

Active Line Highlight

When you click in the JS editor or as you add code in it, the active line is highlighted in pale blue color.

Undo / Redo

You can use Ctrl+Z and Ctrl+Y to undo and redo the last operation in the JS editor.

Line Numbers

The line numbers are displayed at the left side of the editor.

Auto-completion

The editor provides auto-completion for code keywords and all available message data. Pressing Ctrl+Space provides you with the according proposals. Auto complete feature also displays the list of available functions on the selected data.


Figure: Replace the string With