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:

  1. Create a map, and add one input element to your input message assembly, and two or more output message assemblies.

    Figure that shows map with the input and the output message assemblies.

  2. Define an If transform between the input element and one of the output message assemblies.

    Figure that shows the If transform defined.

    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.

  3. Delete the Move transform marked with an error, and then connect the input Properties tree to the If transform.

    Figure that shows the connection between the Properties tree and the If transform.

  4. Optional: Add the ElseIf transform and complete the following steps to connect it to a different output message assembly:
    1. Delete the Move transform that connects the Properties tree and the second output message assembly.
    2. Define a connection between the Properties tree and the ElseIf transform.
    3. Define a connection between the input message and the ElseIf transform.
    4. Define a connection between the ElseIf transform and the second output message assembly.

    Figure that shows map with the pop up to choose the ElseIf transform .

    Figure that shows map with the ElseIf transform and its connections.

  5. Add the Else transform and complete the following steps to connect it to a different output message assembly:
    1. Delete the Move transform that connects the Properties tree and the third output message assembly.
    2. Define a connection between the Properties tree and the Else transform.
    3. Define a connection between the input message and the Else transform.
    4. Define a connection between the Else transform and the second output message assembly.

    Figure that shows map with the pop up to choose the Else transform .

    Figure that shows map with the pop up to choose the Else transform .

  6. Define the conditional expression that determines when the If transform is applied and a message based on the first output message assembly is created.
    1. Open the Properties view of the If transform.
    2. Define an XPath expression in the Condition tab. Use content-assist. For more information, see Defining an XPath conditional expression for a transform.

    Figure that shows map with the If transform Properties view .

    Figure that shows the If condition.

  7. Define the conditional expression that determines when the ElseIf transform is applied and a message based on the second output message assembly is created.
    1. Open the Properties view of the If transform.
    2. Define an XPath expression in the Condition tab. Use content-assist. For more information, see Defining an XPath conditional expression for a transform.

    Figure that shows the ElseIf condition.

    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.
  8. 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.

    Figure that shows the If nested map.

    For more information, see Transform types in the Graphical Data Mapping editor.

  9. Select the ElseIf transform to open the associated nested map. Then, define transforms between the input and the output elements.
  10. Select the Else transform to open the associated nested map. Then, define transforms between the input and the output elements.