Splitting an input message into multiple output messages
You can use a For Each transform or a Join transform wired to the head of the output message assembly to create a map that takes a single input message and produces multiple instances of an output message model. A typical use of this function is message splitting, in which an input batch message is divided into individual record messages.
About this task
When the map runs, a new message is propagated for each iteration of the For Each or Join transform.
Procedure
Complete the following steps to split a message into multiple output messages by using the For Each transform:
Example
- Each instance of the For Each transform produces an output message.
- The repeating element H has three elements that are used to set the values of the output message, which only has two elements.
- An additional input element is needed as part of the transformation. This element is used as part of the conditional expression that determines when a set of transformations is applied.
- An If transform is used to model the conditional mapping requirements required to set the value of the output message elements for each index of the For Each transform.
- When the value of the input element A is equal to the value of the input element H1, then the If transform is applied. Otherwise, the transformation logic in an Else transform is applied.
Complete the following steps to define the transformation logic:
Open the For Each transform nested map.
- Define a primary connection between H and the If transform.
- Define a supplement connection between A and the If transform.
- Define a connection between the If transform and the output element a.
Define a Move transform between H1 and a. This operation defines the transformation logic that the If transform performs.
- Define a primary connection between H and the Else transform.
- Define a supplement connection between A and the Else transform.
- Define a connection between the Else transform and the output element a.
Define a Move transform between H2 and a. This operation defines the transformation logic that the Else transform performs.
The following figure shows the For Each transform nested map after all the transformation logic has been implemented: