Add a Condition This page last changed on Feb 26, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Add a Condition to an Update Block This topic describes how to add a condition to an update block in an update map. Overview Example See Also ## Overview In the update map, you can override an Update block by defining conditions in the expression editor that determine when the block is updated. ##### A Condition in the Expression Editor A condition is a Boolean expression based on XQuery functions and values defined in the update map, for example:
    fn-bea:value($CUSTOMER/CUSTOMER_ORDER/TOTAL_ORDER_AMT) > 1000
3. For example, you might have a logical data service with a return type that combines Customer, Order, and CreditRating data. Each customer can have multiple orders and one credit rating. ##### Return Type with Customer, Order, and CreditRating Data ## Example In the update map, you may want to set a condition that a customer's credit rating can only be updated if the customer places an order with an amount greater than 1000.00. To set an update map condition: Click the Update Map tab. Click the update block on the left that contains the element for which you want to set the condition (for example, the CREDITRATING box for the CREDITRATING/RATING element). You can now enter a condition in the expression editor. Enter a condition in the Condition box, for example:
       fn-bea:value($CUSTOMER/CUSTOMER_ORDER/TOTAL_ORDER_AMT) > 1000.00
Save the data service. Click the Test tab. The logical data service returns data that looks like this: Run a read function, then click Edit and attempt to submit a value for the element that has the condition. When you test the update map, you can only update the CREDITRATING data source if TOTAL_ORDER_AMT for any of the customer's orders is greater than 1000.00. ## See Also ##### Concepts Understanding Update Maps The XQuery Expression Editor ##### How Tos Test a Read Function and Simple Update ##### Other Resources W3Schools XQuery Tutorial

Document generated by Confluence on Jan 13, 2009 15:57