Using Oracle Mapper Oracle Integration
Using Oracle Mapper Oracle Integration
E85415-21
January 2022
Oracle Cloud Using the Oracle Mapper with Oracle Integration,
E85415-21
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on
behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software,
any programs embedded, installed or activated on delivered hardware, and modifications of such programs)
and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end
users are "commercial computer software" or "commercial computer software documentation" pursuant to the
applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use,
reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or
adaptation of i) Oracle programs (including any operating system, integrated software, any programs
embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle
computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the
license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud
services are defined by the applicable contract for such services. No other rights are granted to the U.S.
Government.
This software or hardware is developed for general use in a variety of information management applications.
It is not developed or intended for use in any inherently dangerous applications, including applications that
may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you
shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its
safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this
software or hardware in dangerous applications.
Oracle, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc,
and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered
trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise
set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be
responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth in an applicable agreement between you and Oracle.
Contents
Preface
Audience v
Documentation Accessibility v
Diversity and Inclusion v
Related Resources vi
Conventions vi
2 Map Data
Accept Mapping Recommendations with the Recommendations Engine 2-1
Disable and Enable the Oracle Recommendations Engine 2-1
Accept Target Element Mapping Recommendations 2-2
Search Data Fields 2-3
Filter the Source or Target Data Structures 2-4
Edit XSLT Code in the Mapper 2-4
Test Your Mappings 2-10
Delete Mappings and Target Element Nodes 2-12
Troubleshoot Errors 2-13
Repeat a Target Element to Map to Different Sources 2-14
Map Multiple Source Structures to a Target Structure 2-14
Extend a Data Type 2-16
Import a Map File into an Orchestrated Integration 2-16
iii
3 Work with Functions, Operators, and XSLT Statements
Add Functions, Operators, and XSLT Statements 3-1
Get Help to Use Functions 3-4
Automatically Create for-each Statements 3-5
Create Conditional Mappings 3-6
Set Default Values in the Mapper 3-8
Reference Lookups 3-8
Create the lookupValue Function 3-9
Access the Build Lookup Function Wizard 3-10
Select the Lookup Table 3-10
Select the Source and Target Columns 3-11
Specify the Default Value 3-11
Review Your Lookup Table Selections 3-11
Work with Multiple Value Statements 3-12
iv
Preface
Using the Oracle Mapper with Oracle Integration describes how to use the mapper to map
source data structures to target data structures.
Note:
The information in this guide applies to all of your Oracle Integration instances. It
doesn’t matter which edition you’re using, what features you have, or who manages
your cloud environment. You’ll find what you need here, including notes about any
differences between the various flavors of Oracle Integration when necessary.
Topics:
• Audience
• Documentation Accessibility
• Diversity and Inclusion
• Related Resources
• Conventions
Audience
Using the Oracle Mapper with Oracle Integration is intended for users who want to use the
mapper to map source data structures to target data structures.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility
Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
v
Preface
partners, we are working to remove insensitive terms from our products and
documentation. We are also mindful of the necessity to maintain compatibility with our
customers' existing technologies and the need to ensure continuity of service as
Oracle's offerings and industry standards evolve. Because of these technical
constraints, our effort to remove insensitive terms is ongoing and will take time and
external cooperation.
Related Resources
See these Oracle resources:
• Oracle Cloud
http://cloud.oracle.com
• Using Integrations in Oracle Integration
Conventions
The following text conventions are used in this document:
Convention Meaning
boldface Boldface type indicates graphical user interface elements associated
with an action, or terms defined in text or the glossary.
italic Italic type indicates book titles, emphasis, or placeholder variables for
which you supply particular values.
monospace Monospace type indicates commands within a paragraph, URLs, code
in examples, text that appears on the screen, or text that you enter.
vi
1
Get Started with the Mapper
Review the following topics for an overview of how to use the mapper to map source data
structures to target data structures.
Topics
• About Mappings
• About Mapping Data Between Applications
• About the Expression Builder
• Access the Mapper
About Mappings
One of the key tasks to any integration is defining how data is transferred, or mapped,
between two applications.
In most cases, the messages you want to transfer between the applications in an integration
have different data structures. A visual mapper enables you to map element nodes between
applications by dragging source element nodes onto target element nodes. When you open
the mapper for a request or response message in an integration, the data structures are
automatically populated with the information pulled from the source and target connections.
You can expand and load data structure levels on demand to display additional levels. There
is no limit on the levels of display.
The maps you create are called transformation maps, and use the eXtensible Stylesheet
Language (XSL) to describe the data mappings, which let you perform complex data
manipulation and transformation. A standard set of XSLT constructs are provided (for
example, xsl:if, xsl:for-each, and others). A specialized function is also provided for you
to reference lookups directly from the mapper.
1-1
Chapter 1
About Mappings
Note:
The mapper supports XSL version 2.0. Version 1.0 is not supported.
The mapper supports both qualified and unqualified schemas (that is, schemas without
elementFormDefault=”qualified”). Elements and attributes with and without
namespace prefixes are also supported.
Substitution groups in schemas are supported. You can see all the substitutable
elements in a base element in the mapper, and select the one to use.
Extended data types are also supported.
Elements and attributes for which mapping is required are identified by a blue asterisk
(*) to the left of their names. To display only required fields, click the Filter icon in the
mapper toolbar, select Required Fields, and click Apply.
You can also right-click elements and attributes and select Node Info to show specific
schema details such as the data type, if mapping is required, and so on.
Additional custom annotations can also be displayed. These annotations are currently
only available with the Oracle Sales Cloud Adapter. The Oracle Engagement Cloud
Adapter obtains this information from the applications and annotates it in the
integration WSDL. This information is then read and made visible as annotations in the
mapper (for example, title and description). This information can help you better
understand what data is being mapped.
The mapper toolbar provides the following functionality.
Element Description
Click to return to the mapping canvas when
you are inside the Code, Test, or Recommend
page.
You can view the XSLT code being created as
you design your mappings.
Once you complete designing your mappings,
you can test them by entering sample content
of the message to process in the mapping
tester.
If you enable the recommendations engine,
you can accept the target element
recommendations of the engine when creating
mappings. This eliminates the need to analyze
and perform each individual source-to-target
mapping.
1-2
Chapter 1
About Mapping Data Between Applications
Element Description
Click to disable user-friendly, source and target
element names in the mapper. By default,
user-friendly element names are shown.
Click to show the XSLT functions.
You can select the following options:
• Select to show the namespace prefixes on
source and target element nodes.
• Select to show the types (prefixes and
data types) on source and target element
nodes.
You can filter the display of element nodes,
error messages, and warnings in the source or
target data structures.
You can select to undo the previous action
performed in the mapper. For example, if you
perform a mapping, then press this button, the
mapping is removed. The link is disabled when
all actions have been undone.
You can redo the action that was undone.
1. To map fields directly, click a source element nodes and drag it to the corresponding field
in the target element node.
1-3
Chapter 1
View User-Friendly Element Names
A blue line connects the two nodes. An Expression Builder below the mapper is
displayed to show the XPath expression.
2. To use functions, operators, or XSLT statements in your mapping, see Work with
Functions, Operators, and XSLT Statements.
3. When you are done mapping data, click Close, then click Apply to save your
changes when prompted. You can also click Validate to save your changes.
1-4
Chapter 1
View User-Friendly Element Names
1. Click
2. Click
Adapter Names
In user-friendly mode, adapter names are displayed along with the adapter's associated icon
and the type of payload (request/response). For this example, the source REST Adapter and
Oracle Commerce Cloud Adapter and the target REST Adapter are displayed.
1. Click
1-5
Chapter 1
View User-Friendly Element Names
1-6
Chapter 1
View User-Friendly Element Names
1-7
Chapter 1
View User-Friendly Element Names
The attributes of the schema elements are rendered with the @ prefix followed by the
attribute name in the mapper. With user-friendly names, the @ prefix is not appended to
the front of the name or in user-friendly mode. In technical mode, the attributes are
shown appended with the @ prefix.
User-friendly names do not include the namespace prefix. The option to view element
names with the prefix Show prefixes available in the View menu of the mapper is
disabled when the mapper is in user-friendly mode. The option is enabled once you
switch to technical mode.
1-8
Chapter 1
View User-Friendly Element Names
concat($EDI-Translate/nsmpr0:executeResponse/ns31:TranslateOutput/
ns31:translation-status,
$EDI-Translate/nsmpr0:executeResponse/ns31:TranslateOutput/ns31:tracking-
info)
This mapping refers to a concat function whose parameters are two elements from the
payload. The user-friendly expression for this mapping is as follows:
where:
• translation-status is the user-friendly name of the element $EDI-Translate/
nsmpr0:executeResponse/ns31:TranslateOutput/ns31:translation-status
• tracking-info is the user-friendly name of the element $EDI-Translate/
nsmpr0:executeResponse/ns31:TranslateOutput/ns31:tracking-info
Expression Builder
When you navigate to the mapper, the Expression Builder launches in user-friendly mode by
default when you select a target element.
The Expression Builder shows the mapping for the target element selected. As with the
mapper, the Expression Builder also has two modes. User-friendly mode shows the mapping
as a user-friendly expression.
1-9
Chapter 1
About the Expression Builder
To toggle the Expression Builder between the two modes, click the toggle button
available on the right side of the Expression Builder. You can manually edit the existing
mapping in the Expression Builder.
left side of the field. Save ( ) and erase ( ) buttons are displayed on the right
side of the field.
1-10
Chapter 1
About the Expression Builder
3. If you want to remove the value, click , then click to completely remove the
mapping.
4. Drag the source element node to the Expression Builder. You can also highlight the
source element node and click to add a value to the Expression Builder.
1-11
Chapter 1
Access the Mapper
1. Highlight a target element node and click in the Expression Builder to enter set
text mode.
2. Enter text in the Expression Builder.
A letter icon is added to the node. When you place your cursor over the icon, the
text you entered is displayed.
Note:
If you drag a source target node into the Expression Builder while in set
text mode, the mapping value is literally added as text, and not as an
XPath expression.
1-12
Chapter 1
Access the Mapper
1-13
2
Map Data
Use the mapper to drag element nodes in the source structure to element nodes in the target
structure.
Topics
• Accept Mapping Recommendations with the Recommendations Engine
• Search Data Fields
• Filter the Source or Target Data Structures
• Edit XSLT Code in the Mapper
• Testing Your Mappings
• Deleting Mapping Statements
• Troubleshoot Errors
• Repeat a Target Element to Map to Different Sources
• Map Multiple Source Structures to a Target Structure
• Extend a Data Type
• Import a Map File into an Orchestrated Integration
Topics
• Disable and Enable the Oracle Recommendations Engine
• Accept Target Element Mapping Recommendations
2-1
Chapter 2
Accept Mapping Recommendations with the Recommendations Engine
Note:
Ensure that you first enable the recommendations engine. See Disable and
Enable the Oracle Recommendations Engine.
2-2
Chapter 2
Search Data Fields
c. Click Close and select Apply to save the mapping and exit the page.
The tree is automatically expanded and scrolls to the first match. If you entered straight
text (for example, country), any element nodes and attributes of the same name are
found. If you search by attribute (for example, @country), only the attributes of the same
name are displayed.
3. Click the V icon to scroll to the next match.
4. When done, click the X icon to dismiss the search facility.
2-3
Chapter 2
Filter the Source or Target Data Structures
3. Click Apply.
Based on your selections, icons are displayed in the mapper toolbar. For example,
2-4
Chapter 2
Edit XSLT Code in the Mapper
manually in a text editor or in a separate graphical tool such as Eclipse or Oracle JDeveloper,
and then re-import the code into the mapper in Oracle Integration.
Editing of XSLT code for advanced use cases such as the following is supported:
• Create internal variables using <xsl:variable>
• Correlate multiple sources grouped by key fields using <xsl:for-each-group>
• Dynamically create target name-value pairs based on runtime data using <xsl:element>,
<xsl:attribute>
• Implement "push style" XSLT using <xsl:template>, <xsl:call-template>, and
<xsl:apply-templates>
• Write your own functions in XSLT using <xsl:function>
• Copy node sets using <xsl:copy> and <xsl:copy-of>
1. Click Code.
The current XSLT code for your mappings is displayed.
Restrictions on Editing
The following sections of your XSLT code remain read-only and cannot be edited.
• Attribute version numbers:
<xsl:stylesheet version="2.0"
• The mapper schema section where sources and targets are specified:
<oracle-xsl-mapper:schema xml:id="id_2">
<!--SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT
MODIFY.-->
<oracle-xsl-mapper:mapSources xml:id="id_3">
<oracle-xsl-mapper:source type="WSDL" xml:id="id_4">
<oracle-xsl-mapper:schema location="../../
2-5
Chapter 2
Edit XSLT Code in the Mapper
application_8/outbound_9/resourcegroup_10/echoRequest_REQUEST.wsdl"
xml:id="id_5"/>
<oracle-xsl-mapper:rootElement
name="execute" namespace="http://xmlns.oracle.com/cloud/adapter/
REST/echoRequest_REQUEST/types" xml:id="id_6"/>
</oracle-xsl-mapper:source>
<oracle-xsl-mapper:source type="WSDL"
xml:id="id_20">
<oracle-xsl-mapper:schema location="../../
processor_83/resourcegroup_84/sList_REQUEST.wsdl" xml:id="id_21"/>
<oracle-xsl-mapper:rootElement
name="ListFilesResponse" namespace="http://xmlns.oracle.com/cloud/
adapter/stagefile/sList_REQUEST/types" xml:id="id_22"/>
<oracle-xsl-mapper:param name="sList"
xml:id="id_23"/>
</oracle-xsl-mapper:source>
<oracle-xsl-mapper:source type="XSD"
xml:id="id_24">
<oracle-xsl-mapper:schema location="../../
processor_27/resourcegroup_28/ICSIntegrationMetadata.xsd"
xml:id="id_25"/>
<oracle-xsl-mapper:rootElement
name="metadata" namespace="http://www.oracle.com/2014/03/ic/
integration/metadata" xml:id="id_26"/>
<oracle-xsl-mapper:param name="self"
xml:id="id_27"/>
</oracle-xsl-mapper:source>
</oracle-xsl-mapper:mapSources>
<oracle-xsl-mapper:mapTargets xml:id="id_7">
<oracle-xsl-mapper:target type="WSDL"
xml:id="id_8">
<oracle-xsl-mapper:schema location="../../
application_8/outbound_9/resourcegroup_10/echoRequest_REQUEST.wsdl"
xml:id="id_9"/>
<oracle-xsl-mapper:rootElement
name="executeResponse" namespace="http://xmlns.oracle.com/cloud/
adapter/REST/echoRequest_REQUEST/types" xml:id="id_10"/>
</oracle-xsl-mapper:target>
</oracle-xsl-mapper:mapTargets>
<!--GENERATED BY ORACLE XSL MAPPER 12.1.2.0.0-->
</oracle-xsl-mapper:schema>
Toolbar Options
The toolbar above your XSLT code provides a series of shortcuts for navigating
through and editing XSLT code.
2-6
Chapter 2
Edit XSLT Code in the Mapper
Option Description
Undo your last editing changes to the XSLT code.
Redo your last editing changes to the XSLT code.
) and previous
(
2-7
Chapter 2
Edit XSLT Code in the Mapper
For example, assume you have the following XSLT code that you want to replace:
<nstrgdfl:Welcome
<nstrgdfl:Welcome xml:id="id_19">"Welcome to OIC!!! Echo
was successful."
</nstrgdfl:Welcome>
1. Replace the literal value of "Welcome to OIC!!! Echo was successful." with the
variable $tracking_var_3:
<nstrgdfl:Welcome xml:id="id_19">
<xsl:value-of select="$tracking_var_3" xml:id="id_18"/>
</nstrgdfl:Welcome>
2. Click Designer.
The designer is updated to reflect your changes:
Note:
If you make changes that the mapper does not recognize and attempt to
click Designer, the tab is disabled and a message is displayed indicating
that the change is not supported. You must resolve those issues before
you can return to the designer.
3. Click Validate or Close (which also performs validation) to exit the mapper, then
click Apply to save your changes when prompted.
Code Validation
As you make updates to the XSLT code, your changes are validated. Validation
safeguards prevent you from returning to the designer if there are errors. For example:
2-8
Chapter 2
Edit XSLT Code in the Mapper
• Typographical errors:
1. Assume you make a typographical error such as forgetting the f at the end of
xsl:value o.
2. Click Designer. An error message is displayed in the banner and you are prevented
from returning to the designer until you fix the error.
Unknown: xsl:value-o
2. Click Designer. An error message is displayed in the banner and you are prevented
from returning to the designer or accessing other tabs such as Test until you fix the
error.
There are syntax errors in the edited code. Please fix them before
navigating away from the tab
2. Expand the number to the left of the error for details. For example:
2-9
Chapter 2
Test Your Mappings
These are coding patterns and constructors that are not supported in the
designer. The designer does not know how to render or manage them. When
the XSTL code includes unsupported patterns or constructors, you cannot
navigate to the designer.
Note:
Custom JavaScript functions cannot be tested.
Two elements are generated when the element is defined as repeating. This is useful
for generating payloads containing at least two repeating elements to test for-each
loops in the mapper.
1. In the mapper toolbar, click Test.
The mapping tester appears. The names of the source data structures for your
mapping are displayed at the top. Two instances are also generated and displayed
for repeating nodes.
2. In the Input panel, you can manually enter the payload, copy and paste the
payload, or click Generate Inputs to automatically generate and test the payload.
Payloads for scalar parameters are not created.
2-10
Chapter 2
Test Your Mappings
If your mapping includes multiple source data structures, both names are displayed.
Payloads for both sources can be generated.
Note:
If the payload is very large, it is not automatically generated and you receive the
following error message:
3. Scroll through the input payload and note the following details:
• Unbounded, repeating elements are displayed multiple times.
• Schemas of up to 20 levels in depth can be displayed.
• Random values are automatically generated for payload elements. Based on the
data type of the element, the correct values (for example, numerical or string values)
are generated.
• You can manually edit the randomly-generated values, as necessary.
4. Click Execute to generate results in the Target panel.
5. Review the results in the Target panel to ensure that your input payload was processed
correctly.
2-11
Chapter 2
Delete Mappings and Target Element Nodes
6. Test your mapping and, as necessary, return to the mapper to make mapping
changes, such as changing the XSLT statements or functions used.
7. To clear the Input and Target panels, click Clear.
8. When testing is complete, click Designer to return to the mapper.
Multiple entries are generated for template parameters. There should be only be
one instance of each template parameter. This is the expected behavior. For
example, /subscriptions/{SubscriptionPUID}/child/products/
{SubscriptionProductPUID} generates repeating elements for template
parameters SubscriptionPUID and SubscriptionProductPUID.
Deleting Mappings
To delete mappings:
1. Find the source-to-target mapping to delete.
2. Right-click the target element node name, and select Delete Mapping.
2-12
Chapter 2
Troubleshoot Errors
Note:
• If you delete a parent element node, all of its child element nodes and any
of their mappings are also deleted.
• If you drag an XSLT statement to a target element node, the node must
already exist (cannot be a ghost node). In those cases, you must first right-
click the target element node and select Create Target Node.
Troubleshoot Errors
Your mappings can contain errors. These errors must be resolved before you can activate
your integration. These errors may become visible when you click Validate during mapping
design. Errors may also become visible when you complete your mapping without errors, but
make changes in the overall integration such as regenerating a WSDL. When you return to
the mapper, these errors are visible.
Error messages are identified by red icons and warning messages are identified by yellow
icons above the Sources section of the mapper.
To troubleshoot errors:
1. Expand the numbers in the red and yellow icons to show additional messages.
2-13
Chapter 2
Repeat a Target Element to Map to Different Sources
For this example, there are two invalid target errors. The targets are in the XSLT
file, but not in the schema. This may have occurred because the WSDL was
regenerated after you previously completed mapping.
When adding functions to your mappings, you can also receive errors if you do not
enter all the parameters in the Expression Builder. For example, you add a concat
function to your mapping, but forget to add one or both parameters to the function.
3. To show only the mappings with errors and warnings, click and select
Errors and Warnings. See Filter the Source or Target Data Structures.
The element is repeated and displayed below the existing element. Elements that
are repeated show the count (for example, 1 of 2 for the existing element and 2 of
2 for the repeated element. You can repeat an element multiple times.
2. Expand the existing and repeated elements to see that the attributes in each
element are repeated.
Note:
If you create a repeatable element in which you do not do any mapping,
click Close, and apply your changes when prompted, the empty element
is not saved.
2-14
Chapter 2
Map Multiple Source Structures to a Target Structure
points have been added or integrations with a response mapping). This action applies to the
creation of new maps.
To map multiple source structures to a target structure:
1. In the mapper, note that two source structures are displayed:
• The initial request mapping source (for this example, process)
• The secondary request (for this example, $TargetApplicationObject1)
2. Expand the initial source data structure and drag appropriate source element nodes to
target element nodes.
3. Expand the secondary source data structure and drag appropriate source element nodes
to target element nodes.
2-15
Chapter 2
Extend a Data Type
2-16
Chapter 2
Import a Map File into an Orchestrated Integration
2. Browse for the map file to import, then click Import. You only import the map file of an
exported integration into Oracle Integration. You do not import the entire integration in
which the map file is included into Oracle Integration.
2-17
3
Work with Functions, Operators, and XSLT
Statements
You can add functions, operators, and XSLT statements to your mappings.
Topics
• Add Functions, Operators, and XSLT Statements
• Create Conditional Mappings
• Referencing Lookups
• Create the lookupValue Function
• Work with Multiple Value Statements
• Set Default Values in the Mapper
3-1
Chapter 3
Add Functions, Operators, and XSLT Statements
Note:
You can also initially drag functions to the Expression Builder and then
connect the source element(s) to the function.
5. In the Sources section, drag the source element nodes to the function in the
Expression Builder. For this example, effectiveStartDate and effectiveEndDate
are dragged to the two sides of the comma in the concat( , ) function in the
Expression Builder. Do not drag source element nodes to the function icon in the
Mapping Canvas section.
You can also drag functions onto existing mappings. Assume you have the
following simple mapping.
7. Drag a function (for this example, concat) onto the line in the Mapping Canvas
that connects the two elements.
This action adds the function to the line and shows the concat function in the
Expression Builder. The existing source element mapping is added to the left side
of the comma.
3-2
Chapter 3
Add Functions, Operators, and XSLT Statements
3. Drag appropriate source elements to both sides of the operator or manually enter values.
3-3
Chapter 3
Add Functions, Operators, and XSLT Statements
3-4
Chapter 3
Automatically Create for-each Statements
4. Click the link. Details about the function are displayed at the https://www.w3.org/TR/
xpath-functions site, including a summary, signature, properties to specify, rules, any
specific usage notes, and examples.
The mapper creates a for-each statement to loop through the source Relationship
element and place the mapping into the target Organization element. This statement
does not include a value to select because parent elements do not typically contain
attributes to map.
3. Click Code to view the for-each statement.
<xsl:for-each select="/nssrcmpr:createOrganizationAsync/
nssrcmpr:organizationParty/nsmpr5:Relationship">
<nstrgmpr:Organization xml:id="id_27">
<rnb_v1_2:ID xml:id="id_28" id="{/
3-5
Chapter 3
Create Conditional Mappings
nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:PartyId}"/>
<rnb_v1_2:LookupName xml:id="id_30">
<xsl:value-of xml:id="id_31" select="/
nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:PartyName"/>
</rnb_v1_2:LookupName>
<rnb_v1_2:CreatedTime xml:id="id_34">
<xsl:value-of xml:id="id_35" select="/
nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:CreationDate"/>
</rnb_v1_2:CreatedTime>
<rnb_v1_2:UpdatedTime xml:id="id_32">
<xsl:value-of xml:id="id_36" select="/
nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:LastUpdateDate"/>
</rnb_v1_2:UpdatedTime>
<rno_v1_2:Addresses xml:id="id_37">
<rno_v1_2:TypedAddressList
xml:id="id_38">
<rno_v1_2:Country xml:id="id_41">
<rnb_v1_2:ID xml:id="id_42"
id="{/nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:Country}"/>
</rno_v1_2:Country>
<rno_v1_2:Street xml:id="id_39">
<xsl:value-of
xml:id="id_40" select="/nssrcmpr:createOrganizationAsync/
nssrcmpr:organizationParty/nsmpr5:Address1"/>
</rno_v1_2:Street>
</rno_v1_2:TypedAddressList>
</rno_v1_2:Addresses>
<rno_v1_2:NameFurigana>
<xsl:value-of select="/
nssrcmpr:createOrganizationAsync/nssrcmpr:organizationParty/
nsmpr5:HQBranchIndicator"/>
</rno_v1_2:NameFurigana>
</nstrgmpr:Organization>
</xsl:for-each>
3-6
Chapter 3
Create Conditional Mappings
6. If you add a choose statement, you may specify additional when and otherwise
conditions.
• Highlight the choose action, then drag and drop a when or otherwise statement.
3-7
Chapter 3
Reference Lookups
In the payload, you can set the default value in the mapper.
This syntax checks if the iD node is present in the payload. If so, it assigns that value.
Otherwise, it adds the default value, which in this case is 1000.
Reference Lookups
A special lookup function in the mapper enables you to call a lookup from a mapping
to determine the value to populate into a field when transferring data between
applications.
To reference a lookup from a data mapping:
3-8
Chapter 3
Create the lookupValue Function
1. Drag the source element node to a target element node to create a simple mapping.
Note:
Lookups referenced using the lookupValue function in the Expression Builder are
included in an exported integration JAR file. When you import the integration, the
referenced lookups are also imported and are visible in the Expression Builder. For
information exporting integrations, see Exporting an Integration.
3-9
Chapter 3
Create the lookupValue Function
column, and default value to use in the function. For these parameter values to be
selectable in the wizard, you must have already created a lookup on the Lookups
page.
Topics
• Access the Build Lookup Function Wizard
• Select the Lookup Table
• Select the Source and Target Columns
• Specify the Default Value
• Review Your Lookup Table Selections
Note:
You must already have created lookups to use this wizard. See Creating a
Lookup of Using Integrations in Oracle Integration.
Note:
If you drag the function to a ghost (not yet created) element, the element
is first created.
The Build Lookup Function wizard is displayed. To create the function parameter
values, see section Select the Lookup Table.
Note:
You must already have created a lookup. Otherwise, no lookups are
displayed for selection.
3-10
Chapter 3
Create the lookupValue Function
Element Description
Lookup Table Select the lookup table to use in the function. You
can view the lookup description by clicking the
information icon in the table. This can guide you in
selecting the required lookup table. The number of
columns defined in the lookup is also displayed.
The lookupValue function requires one source column and one target column. When you
select a source and target column, the values available with the columns are displayed.
Element Description
Select Source Column Click the source column header to select from a
list of available columns for this lookup table. The
data included with the selected column is
displayed. Both adapter and domain name
columns are displayed.
Select Target Column Click the target column header to select from a list
of available columns for this lookup table. The data
included with the selected column is displayed.
Both adapter and domain name columns are
displayed.
Enter the default value to use if no match is found. If there is no match that satisfies all the
search values, the lookup fails and the default value is returned.
Element Description
Default Value Enter a default value to use if no match is found
(for example, an actual default value to use or an
error message such as No Value Found).
3-11
Chapter 3
Work with Multiple Value Statements
Element Description
Parameter and Value Table Displays a summary of the parameters and
values you defined on previous pages of the
wizard.
To return to a previous page to update any
values, click the appropriate tab in the left
panel or click Back.
Resulting Expression Displays the expression you defined on the
previous pages of the wizard. The
lookupValue function takes the following
format:
lookupValue(dvmLocation,
srcColumn, srcValue,
targetColumn, defaultValue)
Where:
• dvmLocation: The lookup table selected
on the Select Lookup Table page.
• srcColumn: The source column selected
on the Select Columns page.
• srcValue: The source value you enter in
the New Condition field of the Expression
Builder after completing this wizard. Click
Done to complete this wizard, then define
the srcValue parameter value.
• targetColumn: The target column
selected on the Select Columns page.
• defaultValue: The default value entered
on the Default Value page.
For example, a defined lookupValue function
after you have completed the wizard and
defined the srcValue parameter value in the
Expression Builder can look as follows:
dvm:lookupValue('tenant/resources/
dvms/
Country','rightnow','US','mysoap',
'No data found')
When you click Done, the function icon is created in the mapper and the function
XPath expression is displayed in the Expression Builder.
3-12
Chapter 3
Work with Multiple Value Statements
2. Drag a value-of statement to a leaf element target in the mapper. For this example,
value-of is added as a child of POHeaderId.
3. Define appropriate mapping logic for each value-of statement. For example, add a
choose statement and a when statement with a defined value to the first value-of
statement and an otherwise statement to the second value-of statement.
3-13
Chapter 3
Work with Multiple Value Statements
Note:
Multiple value-of XSLT statements in a leaf node continue to remain visible
in the mapper even if you disable Advanced.
3-14
4
Mapper Use Cases
Learn about use cases with the mapper.
Topics:
• Convert an Integer to a String
• Use Conditional Mappings
• Use a Counter Inside a For-Each Loop to Track the Number of Loop Iterations
• Create an XSLT Map to Read Multiple Correlated Payloads
• Convert a Date Timestamp to a UNIX Timestamp
• Pass Single Quotes in a Mapper Variable
3. In the upper far right corner, click to open the Components panel.
4. Expand Functions > Conversion.
5. Select the string function and drag it to the target element node.
A function icon is added to the mapping canvas for the target element node and the
string function XPath expression is added to the Expression Builder at the bottom of the
page.
6. Drag the source integer node (or you can use a literal) inside the parenthesis and click
the Checkmark icon to save.
For example:
string (12345)
7. Click Validate.
You can navigate to Test > Generate Inputs > Execute to see how the XPath function
performs at runtime.
4-1
Chapter 4
Use Conditional Mappings
if PER03 == 'TE' {
Contact.Phone = PER04
}
if PER05 == 'TE' {
Contact.Phone = PER06
}
if PER07 == 'TE' {
Contact.Phone = PER08
}
1. Click .
4-2
Chapter 4
Use Conditional Mappings
The cursor position surrounding phone indicates whether the choose statement can be
inserted as a child (bottom left) or a parent (upper right). For this case, choose is
inserted as a child.
7. Drag and drop a when statement as a child of the choose statement three times to
create placeholders for the three conditions. You can also drop a when statement as a
sibling before or as a sibling after another when statement.
4-3
Chapter 4
Use Conditional Mappings
Expressions for the first condition and mapping can now be created.
4-4
Chapter 4
Use Conditional Mappings
9. Select the first when statement in the target tree to create the first condition.
10. Drag and drop PER03 from the source tree into the expression.
13. To create the mapping, select the value-of statement under the first when.
14. Drag and drop PER04 into the target value-of statement.
if PER05 == 'TE' {
Contact.Phone = PER06
}
if PER07 == 'TE' {
Contact.Phone = PER08
}
4-5
Chapter 4
Use a Counter Inside a For-Each Loop to Track the Number of Loop Iterations
4-6
Chapter 4
Create an XSLT Map to Read Multiple Correlated Payloads
<company>
<bu>
<id>SD</id> <name>Software Development</name>
<accounbtid>i9</accountid>
</bu>
<bu>
<id>BS</id> <name>Sales</name>
<accounbtid>i1</accountid>
</bu>
<bu>
<id>MD</id> <name>Marketing</name>
<accounbtid>i2</accountid>
</bu>
</company>
• $Employees
<people>
<emp> <buid>SD</buid> <name>Joe Smith</name> </emp>
<emp> <buid>SD</buid> <name>Mike Jones</name> </emp>
4-7
Chapter 4
Create an XSLT Map to Read Multiple Correlated Payloads
• $GLAccounts
<gl>
<account> <id>i1</id> <number>001.345</number> </account>
<account> <id>i2</id> <number>001.477</number> </account>
<account> <id>i9</id> <number>001.223</number> </account>
</gl>
The link between $BusinessUnits and $Employees is the business unit ID. The header
is $BusinessUnit and the detail is $Employees. The link for the GL accounts and
business units is the account ID.
The following output is needed:
<xxx>
<yyy>
<BU id='SD'>Software Development</BU>
<empName>Joe Smith</empName>
<accNumber>001.223</accNumber>
</yyy>
<yyy>
<BU id='SD'>Software Development</BU>
<empName>Mike Jones</empName>
<accNumber>001.223</accNumber>
</yyy>
<yyy>
<BU id='BS'>Sales</BU>
<empName>Dave Johnson</empName>
<accNumber>001.345</accNumber>
</yyy>
</xxx>
Solution
When the instances (records) of the sources have a 1:1 correlation, you can use a
predicate.
When the instances have 1:0..n correlation, using an xsl:for-each-group performs
better than using predicates because it avoids overparsing the source.
The XSLT content is as follows:
4-8
Chapter 4
Create an XSLT Map to Read Multiple Correlated Payloads
<xxx>
<xsl:for-each-group select="$Employees/people/employee" group-
by="buid">
<!-- this section will be executed only once per 'buid' -->
<!-- Store the Business Unit Record in a variable -->
<xsl:variable name="BURecord">
<xsl:copy-of select="$BusinessUnits/company/bu[id =
fn:current-grouping-key()]"/>
</xsl:variable>
<!-- Store the GL Account Record in a variable -->
<xsl:variable name="GLAccountRecord">
<xsl:copy-of select="$GLAccounts/gl/account[id = $BURecord/bu/
accountid]" />
</xsl:variable>
<!-- end: executed only once per 'buid' -->
<xsl:for-each select="current-group()">
<!-- iterates the employees within the current 'buid' -->
<yyy>
<BU id="{./buid}">
<xsl:value-of select="$BURecord/bu/name" />
</BU>
<empName>
<xsl:value-of select="./name" />
</empName>
<accNumber>
<xsl:value-of select="$GLAccountRecord/account/
number"/>
</accNumber>
</yyy>
</xsl:for-each>
</xsl:for-each-group>
</xxx>
</xsl:template>
</xsl:stylesheet>
Summary
• When there is a 1:1 relationship, using predicates instead of <xsl:for-each-group> is
faster because XSLT does not need to sort the data to create the group.
• When there is a 1:0..n relationship, using <xsl:for-each-group> performs faster than
using predicates. This is because predicates, in the above example, parse the entire
business unit source and GL account source per every employee.
See:
• XPath predicates
• xsl:for-each example
4-9
Chapter 4
Convert a Date Timestamp to a UNIX Timestamp
Use an XSL variable to denote single quotes. You can also use an assign action
variable.
<xsl:value-of select="concat($quote,$value,$quote)"/>
Note that the output on the test page and the Track Instances page shows the
following.
apos;ACTIVATED&apos
This is a display issue only and can be ignored. The value is successfully passed.
4-10
5
Troubleshoot the Mapper
Review the following topics to learn about troubleshooting issues with the mapper.
Topics:
• Current-dateTime Function Does Not Return the Same Number of Digits for All
Timestamp Values
• Import XSLT Code into the Mapper
• Function Not Found Errors During Validation in the Mapper
• format-number Function Error
• Transform an Incoming UTC Timestamp into a Standard Timestamp
• CDATA in XSLT String Functions Causes Problems
YYYY-MM-DDT24:59:59.123Z
YYYY-MM-DDT24:59:59.12Z
If you want the specific format value to be consistent, use the xp20:format-dateTime function
to format the timestamp. For example:
2020-10-30T21:58:15.172Z
5-1
Chapter 5
Function Not Found Errors During Validation in the Mapper
The mapper validates if all the referenced functions are supported. You can only use
supported functions (those visible in the Functions palette in the mapper user
interface) in the mapper in Oracle Integration.
2021-05-24T13:34:45.000000+00:00
2021-05-24 13:34:45
5-2
Chapter 5
CDATA in XSLT String Functions Causes Problems
For example, assume you are using the mapper to hard code a SOAP Adapter header
attribute. The mapper encodes the data, which causes a problem for the endpoint service at
runtime.
• Mapping:
• Code:
<tns:header xml:id="id_48">
<xsl:value-of xml:id="id_82" select="'<!
[CDATA[ <CrosstalkMessage>
<CrosstalkHeader> <ProcessCode>1004</ProcessCode>
<MessageType>100</MessageType>
<ExchangePattern>7</ExchangePattern>
<EnterpriseId>ace7d6ae
-78a8-f3gh-1d04-9fe0416d053c</EnterpriseId>
<Token>h12749ed-913b
-7e3e-2aef-8dd78255cb40</Token> <DestinationId>b3fbf48e-df96-
f27d
-5fac-38895618064f</DestinationId> <ContentEncoding>utf
-8</ContentEncoding> <ContentType>text/xml</
ContentType>
5-3
Chapter 5
CDATA in XSLT String Functions Causes Problems
To achieve this:
• Write the XML structure using a stage file action.
• Read the XML as opaque content.
• Map to the header element by using decodeBase64 of read content.
• Use the cdata-section-elements attribute in XSLT referring to the header
element.
5-4