Mapping an input message into different output messages
You can use the If transform to create a map that takes a single input message and produces a different output message based on the conditional expression that you define.
About this task
When you configure multiple output message assemblies, each output message assembly has its own properties.
You can configure each output message assembly independently of the others.
Procedure
Complete the following steps to split a message into different output messages by using the If transform:
-
Create a map, and add one input element to your input message assembly, and two
or more output message assemblies.
-
Define an If transform between the input element and one
of the output message assemblies.
The Move transform between the input and the output Properties tree of the first message assembly will display an error. Continue with the steps to remove the error.
-
Delete the Move transform marked with an error, and then
connect the input Properties tree to the If
transform.
- Optional:
Add the ElseIf transform and complete the following
steps to connect it to a different output message assembly:
- Delete the Move transform that connects the Properties tree and the second output message assembly.
- Define a connection between the Properties tree and the ElseIf transform.
- Define a connection between the input message and the ElseIf transform.
- Define a connection between the ElseIf transform and the second output message assembly.
-
Add the Else transform and complete the following steps
to connect it to a different output message assembly:
- Delete the Move transform that connects the Properties tree and the third output message assembly.
- Define a connection between the Properties tree and the Else transform.
- Define a connection between the input message and the Else transform.
- Define a connection between the Else transform and the second output message assembly.
-
Define the conditional expression that determines when the
If transform is applied and a message based on the
first output message assembly is created.
- Open the Properties view of the If transform.
- Define an XPath expression in the Condition tab. Use content-assist. For more information, see Defining an XPath conditional expression for a transform.
-
Define the conditional expression that determines when the
ElseIf transform is applied and a message based on
the second output message assembly is created.
- Open the Properties view of the If transform.
- Define an XPath expression in the Condition tab. Use content-assist. For more information, see Defining an XPath conditional expression for a transform.
Note: When the conditional expression of the If transform and the ElseIf transform evaluate to false, the transformation logic defined for the Else transform is applied. -
Select the If transform to open the associated nested
map. Then, define transforms between the input and the output elements. Remember
to connect the input Properties to the output properties tree with a
Move transform.
By default, a Submap transform is defined. You can choose to create a submap with your transformation logic, or delete the Submap transform and define locally your transformation logic.
For more information, see Transform types in the Graphical Data Mapping editor.
- Select the ElseIf transform to open the associated nested map. Then, define transforms between the input and the output elements.
- Select the Else transform to open the associated nested map. Then, define transforms between the input and the output elements.