If, Else if, and Else
The If, Else if, and Else transform enables you to control the flow of the mapping by setting conditions.
The If, Else if and Else transform operates as a group of conditional transforms. The condition is applied to the input element of the conditional transform. If the condition is satisfied, the transform that is nested within the conditional transform is run.
- For each conditional transform in the group, enter a condition
in the Condition tab in the Properties
view.
You can define a condition expression that is an XPath expression or a call to a static method on an imported Java™ class. You can also create a complex expression comprising, XPath, Java and extension functions such as iib:getUserDefinedProperty("propertyname").
- To change the order in which the conditions are evaluated, select the conditional group and click the Order tab and use the up and down arrows.
- Double-click the conditional transform (for example, If) to create the mapping that will execute for the condition.
The elements in the nested map must be mapped in order for the transform to run.