Join

You can use a Join transform to join elements from two or more inputs into an output element.

Overview

You provide a Join expression to determine which data to transform.

You define the mapping from the joined instances of the input arrays to an output target in the nested map. For more information, see Using nested maps.

The Join transform implements an inner-join.

If you want to implement an outer-join, use the For Each transform with the option Allow Empty input enabled.

Inputs

The inputs to a Join transform can be repeating simple elements or complex type elements, which can be merged using nested transforms to create an output.
  • You configure the inputs to a Join transform with primary connections.
  • You must have at least 2 primary inputs to a Join transform.
  • You can configure the Cardinality property page of each input to indicate which index of an input array to iterate over.
  • You can configure the Order property page to define the order of iteration over the input elements.
  • You can define a Join expression to specify the matching criteria for joining or filtering input repeating elements. The join expressions determines the size of the output element.

You can define additional inputs to the Join transform by using supplement connections. These inputs are passed unchanged to the nested map. You can use these inputs inside your nested map to define conditional expressions in the transforms that you define.

Cardinality

The Cardinality property determines the inputs participating in the join operation.

You configure the Cardinality property tab of a Join transform to define which indexes are used from each input array in the join operation. For more information, see Selecting the indexes of input array elements.

This figure shows the Cardinality tab of the Join transform properties.

Order of the inputs

By default, the order of the inputs to the Join transform is the order in which you wire the inputs.

You can modify the order by reordering the inputs in the Order tab of the transform properties.

Output

The output element can be a simple element or a complex type element that can be repeating or not repeating.

When your output element is a repeating element, the Join expression determines the size of the output element.

For example, if you have a repeating input element of size M, and a repeating input element of size N to a Join transform, the output element size is calculated as follows:
  • If you click the option Create Join expression based on index, the size of the output element is the minimum value of M and N.
  • If you do not define a Join expression or you do not select the option Create Join expression based on index, the size of the output element is MxN.
  • If you define a Join expression, the size of the output element is determined by the expression.

Example 1: To join the first element of the first array with the first element of the second array, you set a join condition that matches based on index. You click Create Join expression based on index.

Example 2: If you do not specify a Join expression, the join matches the first element of the first array with all elements of the second array, and then it matches the second element of the first array with all elements of the second array, and so on.

Join expression

You can define a Join expression to specify the matching criteria for joining or filtering input array elements. This expression is an XPath expression or a call to a static method on an imported Java™ class. You can also create a complex expression comprising, XPath, Java and extension functions such as mb:getUserDefinedProperty("propertyname").
  • You can use content assist to create the expression. For more information, see Using content assist (Mapping syntax).
  • You can select the option Create Join expression based on index. This option requires two repeatable inputs to create the Join expression.

This figure shows the General tab of the Join transform properties.

For example, you can use iib:getUserDefinedProperty("propertyname") on a For Each filter to use a value that is not hard coded in the map, and you can also set dynamically via CMP API.