Java Reference
In-Depth Information
</else>
</if>
The * indicates that zero or more <elseif> constructs are allowed; the ? indicates that zero
or one <else> constructs is allowed.
Here is a complete example:
<if name="checkAvailability">
<condition>
starts-with($purchaseOrder.purchaseOrder/po:orderDescription,
'Product 123')
</condition>
<assign name="InventoryAvailable">
<copy>
<from>true()</from>
<to>$inventoryStatus.inventoryPart/i:inventoryAvail</to>
</copy>
<copy>
<from>'This item is available'</from>
<to>$inventoryStatus.inventoryPart/i:inventoryStatusMessage</to>
</copy>
</assign>
<else>
<assign name="InsufficientQty">
<copy>
<from>false()</from>
<to>$inventoryStatus.inventoryPart/i:inventoryAvail</to>
</copy>
<copy>
<from>'Out of stock'</from>
<to>$inventoryStatus.inventoryPart/
i:inventoryStatusMessage</to>
<copy>
</assign>
</else>
</if>
Here you're using a starts-with expression to determine whether you are dealing with a certain
product. If so, you indicate that inventory is available; otherwise, put a value in the status mes-
sage indicating that you're out.
Search WWH ::




Custom Search