Change a Mapping This page last changed on Nov 27, 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 Change a Mapping This topic describes how to change a mapping in a default update map generated in Workshop for WebLogic. Overview Example See Also ## Overview Once you have generated an update map, you can customize it by adding or removing mappings, changing an XQuery expression, adding dependencies, or changing the return type--all in Workshop for WebLogic. ##### A Sample Update Map Initially, an update map is generated from the primary read function of a logical data service and changes with the read function. Once you customize an update map, it is no longer linked to the primary read function. If you change the primary read function after customizing the update map, either in a dialog box or in the Source tab, the update map does not change as a result. To re-link the update map to the primary read function, you must revert customizations. ## Example To change a mapping: Click the Update Map tab. Right-click an existing mapping line, and choose Delete. Drag from an element in the return type on the right to a new element in a data source on the left. Make sure that the Create, Update, and Delete procedure icons (on both the right and left sides) are still enabled and not disabled . Test the new mapping in the Test tab. ### The CustomerOrderLineItem Service In this service, you can draw a new mapping between elements of the same type. Click the Update Map tab. Right-click the mapping line between CUSTOMER_ORDER/STATUS in the return type and CUSTOMER_ORDER/STATUS in the update block, and choose Delete. Drag a new mapping from CUSTOMER_ORDER_LINE_ITEM/STATUS, the child element in the return type, to CUSTOMER_ORDER/STATUS in the update block. These elements have the same data type. Make sure that the procedure icons are enabled. Click CUSTOMER_ORDER/STATUS on the left, and check the new mapping in the expression editor. Click the Test tab. Run a read function, then click Edit. Choose a CUSTOMER_ORDER element, then change the value of the first CUSTOMER_ORDER_LINE_ITEM/STATUS child element. Click Submit. Run the read function again, then check that the value of CUSTOMER_ORDER/STATUS has changed. In this example, the child element (CUSTOMER_ORDER_LINE_ITEM) has a multiple cardinality, while the parent element (CUSTOMER_ORDER/STATUS) has a single cardinality. You can see this by checking the XML return type in the Overview tab. By default, the first child element value is read to update the data source. You can override this behavior by adding a dependency or writing a custom update function. When you map one element to another, be sure that the elements have the same or compatible data types. To be compatible, data types must be in the same type hierarchy in the XML Schema DataTypes specification, such as xs:integer and xs:decimal. These types are cast automatically. If you draw a mapping between two elements of different types and hierarchies, you must cast one data type to the other, using a built-in cast function or a custom cast function. ## See Also ##### Concepts Understanding Update Maps ##### How Tos Create Your First Data Services The XQuery Expression Editor

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