Remove

You can use the Remove transform to delete an element from the Environment tree or to remove an element within an Overrides group.

Overview

For example, you can use the Remove transform to remove child elements from the target structure if you copy a complex structure from source to target.

The Remove transform does not have any inputs wired to the transform.

You can define a Remove transform on a simple, complex, or repeating output element.

The Remove transform is available in the list of available transforms when you define a transform on an element in the environment tree or when you define a transform on an element within an Overrides group.
Note: A Remove transform in an Overrides group cannot be used to remove a specific xsi:typed element; the Remove transform uses only the element name to identify the target element to remove.

Define when the transform is applied at run time

You can define multiple connections between input elements and the Remove transform. You can then use these input elements in a conditional expression that defines the condition under which the transform is applied. If the condition evaluates to true, the transform is applied.

Alternatively, to define the conditional expression, you can call a static method on an imported Java™ class. You can also create a complex expression comprising XPath, Java and extension functions such as iib:getUserDefinedProperty("propertyname").  

To add inputs to the transform, you can define supplement connections between input elements and the transform.

You configure the expression in the Condition tab that is available in the Properties page of the transform.

For more information, see Configuring the properties of a transform, Defining an XPath conditional expression for a transform and Defining a Java conditional expression for a transform.

Modifying repeating elements

If you need to remove some elements of a repeating structure, use the For Each transform and define conditional expressions for each index to determine whether the element is moved or removed.

For more information, see For Each.

Example

This example shows how to copy an input structure to the output, and then delete one element from the output message structure.

You define a map with a Move transform between the input element and the output element.

This figure shows the main map as it is created, with a Move transform.

You click the element that you want to delete (H2) from the output structure, and then drag and drop the mouse onto the canvas. An Assign transform is added. You change the Assign transform to the Remove transform.

This figure shows the pop up where you can select the Remove transform.

As soon as you select the Remove transform, the Graphical Data Mapping editor adds an Overrides function that groups the Move transform and the Remove transform. The Overrides function specifies that the input element H is copied over unchanged, and then element H2 is deleted from the output structure.

This figure shows the overrides function added to the map.