Configuring the Else If condition in an If, Else if, and Else transform

Create and configure an Else If condition after you define the If condition.

Before you begin

Define the If condition of the If, Else if, and Else transform. For more information, see Configuring the If condition in an If, Else if, and Else transform.

Procedure

Complete the following steps to create and configure the Else If condition of an If, Else if, and Else transform:

  1. Select the diamond symbol located to the left of the If transform. The Add Else If option and the Add Else conditions appear to the right hand side of a light bulb in a pop up on top of the If transform.

    This diamond symbol appears after you set the If condition.

    This image shows the diamond symbol followed by the Else If condition and the Else condition.

  2. Select Add Else If to add another address with a derived type of UKAddress.

    To add an address, select the Add Else If icon This figure shows the symbol you click to add an Else If condition..

    Note: If you have more derived types, repeat this step for each additional address that you have defined.

    When you select the Add Else If condition, the mapping engine creates a Conditions box that includes the If condition and the Else If condition of the If, Else if, and Else transform that you are configuring.

    You get an Else If condition with a red exclamation mark.

    The red exclamation mark on the left hand side of the If condition highlights multiple validation problems which you will resolve by completing the scenario.

    This figure shows the If and Else If conditions in the message map. It also displays the validation problems reported: A condition is missing. There is no output element. No output transformation is produced.

  3. Connect the element Country in the input message assembly object located under SOAP_Domain_Msg > Body > SaveAddress > Person > Address to the Else If condition.

    A connection is created between the element Country and the Else If condition. A window opens informing you that by creating this connection, the transform type changes. Click Click here to continue.

    This figure shows the pop up window that appears after you create the connection between Country and the Else if condition. The option Click Here is available and you must click it to continue.

  4. Connect the element Address with a derived type of UKAddress to the Else If condition.

    A connection is created between the element Country and the Else If condition. A window opens informing you that by creating this connection, the transform type changes. Click Click here to continue.

    This figure shows the pop up window that appears after you create the connection between UKAddress and the Else if condition. The option Click Here is available and you must click it to continue.

  5. Connect the Else If condition to the output element Address.

    When you define this connection to the Else If condition, a pop up message displays to explain that you must transform the input and output elements within the nested map that is created where the input object is an address of type UKAddress, and the output object is an address of type Address. You can click Click Here to access the nested map, or you can click anywhere on the message map to continue configuring the Else If condition.

    This figure shows the message map after you define the connections. It includes the pop up message where it explains that you must transform the input and output elements within the nested map that is created.

  6. Select the Else If condition, and then define the following expression in the Else If transform properties: $Country5 = 'UK'.

    The condition is an XPath 2.0 expression, that you can define directly, or you can create through the XPath expression builder by clicking Edit.

    The following figure shows the properties tab for the Else If transform:

    This figure shows the properties tab for the If transform, and the XPath expression to set the condition.

Results

After you define the Else If condition, the message map contains a Conditions container with two conditions.

What to do next

If there are other conditions, define Else If conditions for each one.

Note: To add more Else If conditions, select Conditions, and then Add Else If.

This figure shows the If and Else If conditions within a Conditions container, and on top of the container the options Add Else If and Add Else that you can select.

Define the Else condition of the If, Else if, and Else transform. For more information, see Configuring the Else condition in an If, Else if, and Else transform.