Create and configure an Else If condition
after you define the If condition.
Procedure
Complete the following steps to create and configure
the Else If condition of an If, Else if, and
Else transform:
- 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.
- Select Add Else If to add another
address with a derived type of UKAddress.
To add an address, select the Add Else If icon .
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.
- Connect the element Country in the
input message assembly object located under 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.
- 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.
- 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.
-
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:
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.
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.