Creating a nil output element

In the Graphical Data Mapping editor, you can use the Create transform, the Move transform, the Custom Java transform, the Custom ESQL transform, or the return value of a database to create a nil output element.

Before you begin

When you map null values, consider the Graphical Data Mapping editor behavior. For more information, see Handling nulls in message maps.

Procedure

Choose any of the following methods to create a nil output element:

  • Use the Create transform. Create a nil element without the use of input data.
  • Use the Move transform. Copy an input element that is nil to an output nil element.
  • Use the Custom Java transform.

    The Java™ method that you implement must return an MbElement that is nil.

  • Use the Custom ESQL transform. Your ESQL code must return a NULL value.
  • Use the database transform, and Move a nullable column to an output nillable element.
  • Use a Custom XPath transform with the function iib:nullValue() to set an XMLNSC element to nil, a JSON object to NULL, and a JSON array to NULL.

Example

Example: Use the Create transform to create a simple type output element as nil

This example shows how to use the Create transform to create a simple type output element as nil in the Graphical Data Mapping editor.

You can use the Create transform to create an output element with xsi:nil="true", also called a nil element, without the use of input data.

Note: The option to create a nil element is available only when the output element is nillable.
Complete the following steps to create a simple nil output element:
  1. Add a Create transform to set the value of the output element.
    1. Click the output element and drag the connector towards the input elements, releasing the connector onto a blank part of the canvas. When you release the connector, an Assign transform is created.
    2. Select the drop-down, and select Core transforms > Create.
  2. In the Properties panel, select the General tab. Then, select Create nil.

    Properties view of a Create transform

Example: Use the Create transform to create a complex type output element as nil

This example shows how to use the Create transform to create a complex type output element as nil in the Graphical Data Mapping editor.

Note: The option to create a nil element is available only when the output element is nillable.
Note: The Create transform has a nested map, however, you cannot create or assign fields within a complex nil output element. You will get the following error: Cannot create or assign fields within nil target. To allow mapping, change parent Create transform to create empty instead of nil.
  1. Click the output element and drag the connector towards the input elements, releasing the connector onto a blank part of the canvas. When you release the connector, a Create transform is created.

    This figure shows the Create transform connected to a complex type

  2. In the Properties panel, select the General tab. Then, select Create nil.

    Properties view of a Create transform