Defining an XPath conditional expression for a structural transform (ForEach)
Configure the Filter Inputs section in the Properties view of the ForEach transform to define the conditional expression that determines whether the transform is applied in a message map.
About this task
The ForEach transform can only have one primary input connection. Additional connections to the ForEach transform must be of type Supplement.
Procedure
Complete the following steps to define a conditional expression on a ForEach transform:
Results
The input element is evaluated against the condition. If the condition evaluates to true, the transform is applied to the input element.
Example
- The ForEach transform has a primary connection wired from the repeating element Address.
- The ForEach transform has a secondary connection wired from the mandatory element BusinessUnit. This element can be set to nil. This element is not used to calculate the value of the output element.
- The ForEach transform should only execute if the BusinessUnit element is not empty.
The XML schema for the mandatory element is the following:
<element name="BusinessUnit" type="string"
nillable="true"></element>
The XML schema for the repeating element is the following:
<xsd:element form="qualified" name="Address" type="mqsistr:Address"
maxOccurs="unbounded" minOccurs="0" />
The XPath expression that you define is the following:
$BusinessUnit != ''
What to do next
Deploy and test the message map. For more information, see Troubleshooting a message map.