Data Mapper is a visual data-mapping tool used for mapping elements in advanced data integration projects. This tool Data Mapper is a visual data-mapping tool used for mapping elements in advanced data integration projects. This tool allows you to specify source and target schemas and to map data fields from source schema to target schema.
...
This is the default and most commonly used method for mapping source and target elements.
Steps to map elements using Drag and Drop approach
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
If the number of leaf elements of the parent element in the source and target schema is same, then you can use the One to One mapping button to map all the source elements to the corresponding target elements.
Steps to use One to One mapping
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click and drag the parent element of the source schema to the parent element of the target schema. This will apply template of the source parent element on the target parent element, and activate the One to One Mapping button.
Click One to One Mapping ( ) button. All the leaf elements of the parent element in the source schema will be mapped to their respective leaf elements of the parent element in the target schema.
Info Only leaf elements are mapped using this button. It does not map complex elements. To map complex elements, you need to use the drag and drop method.
Info If multiple schemas are loaded, then dragging a source parent element will map all leaf elements of schemas displayed previous to the current schema.
Moreover, in multiple schemas, mapping can be performed between parents at any level, if the number of their leaf elements is the same.Anchor automapper automapper
Auto Mapper
If the hierarchy and the names of the complex elements are similar, then you can use the Auto Mapper option to map the source elements to the corresponding target elements. In case of complex elements, the hierarchy and the name of all elements must be the same.Steps to use the Auto Mapper
...
Anchor | ||||
---|---|---|---|---|
|
You can use the Remove All Mappings option to remove all mappings from the Data Mapper.
Steps to remove all mappings between source and target elements
Click Remove all Mapping ( ) button. The Remove Options screen is displayed (see Figure 398).This screen displays a list of the properties, variables, custom methods, keys and templates associated with a mapped element, which can be removed with the mapping.
Figure 398: Remove Options
Info The Remove Mapping, Remove Comments, Remove For Each and Remove Local Variables options are always enabled. The other options are enabled only if they have been defined for the mapped element.
Select the checkbox(s) of the options that you want to remove and click OK button. All the selected options and all mappings between source and target elements will be removed.
Info You can remove mapping associated with each element individually. For details, refer to the section Remove Mapping of an Element.
Anchor CustomAutoMap CustomAutoMap Anchor _Toc226191056 _Toc226191056 Anchor _Toc315524635 _Toc315524635
Custom Auto MapThe Auto Mapper feature can be used only when the elements of source and target schema are at the same hierarchy level and have the same names. However, if you want to automatically map the elements when the names of the elements of source and target schemas are different, you cannot use this feature. For example, if the source schema has elements, EmpFirstName and EmpLastName and the target schema has the elements, firstName and lastName then you cannot define mapping between these two schemas using the Auto Mapper feature.Anchor _Toc315524907 _Toc315524907
To define a mapping between the schemas when the elements of source and target schema are at the different hierarchy level (which may include elements at the different parent and child level) and have the different names, you can use the Custom Auto Map feature. This feature enables you to define the mapping between such schemas where elements to be mapped are stored in different parent and child level and in addition elements name are different.Anchor _Toc344890217 _Toc344890217 Anchor _Toc385441547 _Toc385441547 Anchor _Toc387747386 _Toc387747386 Anchor _Toc387748659 _Toc387748659
Scope of a Custom Auto MapYou can also select the scope of a Custom Auto Map at the time of defining and saving it. Scope of a Custom Auto Map is the context within which it is defined and is accessible within or across the user groups. A Custom Auto Map can be defined in any of the following scope:Anchor _Toc401308956 _Toc401308956
...
When you define a Custom Auto Map, by default it is in deactivated state. To use a Custom Auto Map, you need to first activate it. Once you have activated the Custom Auto Map, you can use it in your mapping. Note that only activated Custom Auto Maps can be used in a mapping.
Steps to Activate a Custom Auto Map
...
After activating a Custom Auto Map, you can use it in your mapping. Note that only one Custom Auto Map can be activated in the current mapping.
Steps to Use the Custom Auto Map in a Mapping
- Load the respective source and target schema.
- Create and activate the Custom Auto Map.
- Map the parent record of the Source schema to the parent record of the Target schema.
Right-click the parent record of the target schema and select Connect Matching Record options (see Figure 408).
Figure 408: Select Connect Matching Children
The Connect Matching Children Dialog window is displayed (see Figure 409).
Figure 409: Connect Matching Children Options
- Select the mapping criteria from the Automap options list. Its options are listed as:
- Ignore Case: The source and the target elements are mapped even if they are of different case. Their attributes are not mapped.
- Ignore Namespace: The source and target elements are mapped, when their names are same but source schema has any namespace prefix.
- Recursive: Elements of parent level as well as all child level with the corresponding target elements.
- Mix Attributes: Attributes of source and target schemas are mapped.
- Select the mapping criteria from the Existing Options list. These options are :
- Retain: If any source and target elements are already mapped, those mapping will not be overwritten.
- Overwrite: Overwrites all the existing mappings.
- Click OK. This will map source and target schema as per the criteria selected (see Figure 410).
...
Editing a Custom Auto Map
In edit mode, you can edit the name of the Custom Auto Map and the source and target elements to be mapped. Note that you cannot edit the scope of a Custom Auto Map in edit mode. The radio buttons to select the scope becomes non-editable once you save the Custom Auto Map. However, you cannot edit the Custom Auto Map when it has been already been used in the mapping and that mapping has been saved.
Steps to Edit a Custom Auto Map
...
Moving a Custom Auto Map from Group to Global
You can also change the scope of a Custom Auto Map from the Parameters Panel by moving the Custom Auto Map from Group to Global. However, you cannot move a Custom Auto Map if it is in the activated state and has been used in mapping. In addition, you cannot move a Custom Auto Map from Global to Group.
Steps to Move a Custom Auto Map
...
This will change the scope of the selected Custom Auto Map and now the Custom Auto Map will be displayed under the Global folder.
Deleting a Custom Auto Map
Steps to Delete a Custom Auto Map
...
Then, you can define the set of values in a csv file as:
Low,L
Medium,M
High,H
Steps to Define a Value Map Using a CSV File
...
Editing a Value Map
In edit mode, you can edit the name of Value Map and the map set for an element value. Note that you cannot edit the scope of a Value Map in edit mode. The radio buttons to select the scope becomes non-editable once you save the Value Map. The radio buttons to select the scope becomes non-editable once you save the Value Map. However, you cannot edit the Value Map when it has been already been used in the mapping and that mapping has been saved.
Steps to Edit a Value Map
...
Moving a Value Map from Group to Global
You can also change the scope of a Value Map from the Parameters Panel by moving the Value Map from Group to Global. However, you cannot move a Value Map if it is has been used in mapping and that mapping has been saved. In addition, you cannot move a Custom Auto Map from Global to Group.
Steps to Move a Value Map
...
This will add the change the scope of the selected Value Map and now the Value Map will be displayed under the Global folder.
Steps to Delete a Value Map
...
Once you have mapped source and target elements, you can save the mapping and exit the Data Mapper.
Steps to save the mapping and exit the Data Mapper
...
Click the XSL tab on the Tabs Panel to view the generated mapping XSL. The generated XSL code with line numbers is displayed (see Figure 445).
Figure 445: Mapping XSL
Click the Action menu and select Validate XSL option to validate the generated XSL. A dialog box is displayed confirming that the XSL is valid.
Info If generated XSL is invalid, then an error is displayed as a selected line. Error details are displayed in the XSL Errors Pane. It displays one error at a time.
Click OK to close the above dialog box.
Info You can also validate the generated XSL from the Create Data Mapping screen. For more details, refer to the section Splitting Source Data.
Anchor viewtargetXML viewtargetXML Anchor _Toc131572371 _Toc131572371 Anchor _Toc134848110 _Toc134848110 Anchor _Toc144023033 _Toc144023033 Anchor _Toc144314279 _Toc144314279 Anchor _Toc177977119 _Toc177977119 Anchor _Toc226191062 _Toc226191062 Anchor _Toc315524642 _Toc315524642
View Mapping XMLThe Data Mapper allows you to view the generated XML code, before saving the mapping activity.Anchor _Toc315524914 _Toc315524914
Steps to view Mapping XML
...
Once you have mapped source and target schema elements, you can view and validate the output of the mapping activity. This feature enables you to test the data and make modifications to the mapping activity, before saving it.
Steps to view and validate mapping output
Click the Debugger tab on the tabs panel to view and validate the output of the mapping activity. The Debugger is displayed on the Data Mapper screen (see Figure 447).
Figure 447: Debugger screen
This screen is divided into five sections as listed in the table below.
Anchor _Toc144313775 _Toc144313775 Anchor _Toc144827053 _Toc144827053 Anchor _Toc156195257 _Toc156195257 Anchor _Toc177878234 _Toc177878234 Anchor _Toc208651129 _Toc208651129
Table 9 : Options of the Debugger ScreenAnchor _Toc315524508 _Toc315524508 Suffix
Description
Input
Displays data for all input schemas in XML format. This data can be mockup data or a selected XML file.
XSL
Displays the generated XSL. You can generate sample output data based on the input data.
Output
Displays the generated output data for all schemas.
Variables/ Params
This section comprises of two tabs:
Variables
Params
The Variables tab displays the local variables that are encountered in the generated XSL.
The Params tab displays all parameters that are defined for a XSL template. These parameters are displayed only if that XSL template is used in the mapping activity.Errors
Displays all errors encountered during debugging.
- Click the Generate Input Mock up Data button displayed in the Input section, to generate the sample input data in XML format. The sample input data contains name of the element as XML Tags and some randomly generated values as their data. The sample input XML file is displayed in the Input section (see Figure 448).
Figure 448: Generate Mockup DataInfo Data will be generated for all input schemas.
- Alternately, you can attach a source file to the root element of the source schema. Right-click the root element of the source schema and select Attach Source from the dropdown list. Select the source file to attach it. This automatically converts the actual data of the source file into XML input data, which can be validated.
Alternately, you can display input data from an existing XML file. Click Load Input XML button ( ) displayed in the Input section to select and upload the existing XML file.
Info Another way of uploading the XML file is right-clicking the Input section and clicking the Load option.
If you load an XML file, then the existing XML code is overwritten. It is not appended.Click the Save button ( ) displayed in the Input section to save the generated input data.
Info You can simulate the mapping either on the desktop or on the server. By default, simulation is done on the desktop. Simulating on the server supports global functions, custom methods, Context Variable, Set Context, Get Context and the DBlookup () functions. However, it can be used only in case of mapping of single source and target elements.
While simulating on the server using context variables, if you assign a value to the context variable using the Set Context function and retrieve its value using the Get Context function, it will return the default value of the context variable, instead of the new value assigned. For example, a context variable 'Var1' has the default value as 10 and is later assigned the value of 20 by Set Context function. When the Get Context function is used to retrieve the value of the variable, it returns 10 instead of 20.- Select the radio button Run on Server if you want to simulate the mapping activity on the server.
Click the Start Execution button displayed in the Output section to generate sample output data based on input data. The generated sample output data is displayed in the Output section (see Figure 449).
Figure 449: Output XSLInfo You can stop the generation of output data at any time by clicking the Stop button displayed in the XSL section.
In In case XML Schema is used at target end, then unmapped elements are filtered out automatically.- Click the Save button ( ) displayed in the Output section to save the generated mapping output.
- A dialog box is displayed using which you can save the XML file at the desired location.
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Map source and target elements and apply the mapping rule as per your need.
To use Data Viewer, click the Data Viewer tab. The Data Viewer panel is displayed (see Figure 450).
Figure 450: Data Viewer
To attach the source file, right click the Root element in the Source Panel and select Attach Source option and select the source file (see Figure 451).
Figure 451: Attach Source
After selecting the source file, again right click the Root element in source panel and select Preview. Source Data is displayed in the Grid View panel (see Figure 452).
Figure 452: Source records in Grid ViewInfo By default maximum 50 records are displayed in the Data Viewer. To view more records, click Action menu and select Set Data Viewer Record Count and enter the desired value. When you change this value, you need re-attach the source.
If there is any error record in the source file, a pop-up message is displayed that "Error Records found in the source data." (see Figure 453).
Figure 453: Pop-up message
- Click OK to close this pop-up message.
To view the source data in Tree View, click the Tree View tab. The source data is selected in the hierarchy view (see Figure 454).
Figure 454: Tree View
To view the values of the record, click [+] to expand the Record. Values of the expanded record are shown (see Figure 455).
Figure 455: Records in Tree View- Similarly to view values of other records, expand other records.
If there is any error encountered in the source data, those error records are shown in the Errors tab. To view the error records, click Errors tab (see Figure 456).
Figure 456: Error Record
To view the output record, right click the Root element of the target panel and select Preview option. The generated output records are displayed in the Target panel of Preview pane (see Figure 457).
Figure 457: Target Records in Grid ViewInfo In case XML Schema is used at target end, then unmapped elements are filtered out automatically.
- To view the error records at the target end, click Errors tab of target panel of Data Viewer. It displays:
- The number of errors occurred during transformation
- The list of errors occurred during transformation
- List of enumerated literals for the target element if invalid data is mapped to the target element which is restricted to the enumerated values
- In case you perform any changes in mapping rules, you need to click to refresh the target data according to mapping rules applied.
- You can also view the output data in hierarchy view, by clicking the Tree View tab.
To expand the Source or Target panel, click . The Source or Target panel is shown in the expanded (see Figure 458).
Figure 458: Target Panel in expanded mode
- To close the expanded Source or Target panel, click .
...
If you have read-only rights, you can still view a mapping activity. You can view the applied mapping, create new mapping rules, edit existing mapping rules and run simulation. However, you cannot save the mapping activity.
Steps to view mapping in read-only mode
...
Splitting feature enables you to process large files. You must use splitting if your source file is huge. If you do not use splitting in this case, then Data Mapper may not be able to map it. If the data in the source file is huge, you can split the source data into different chunks. You can specify the size of the chunks in terms of the number of records or data streams. In the output, however, only one file is generated at the location specified in the target activity.
Steps to split the source data
...
- Ensure that all the source and target schemas are loaded and all their elements are listed under their respective nodes.
Right-click the source schema element that you want to split and select the Set as Splitter XPath option. A screen showing the Splitter XPath details is displayed (see Figure 466).
Figure 466: Splitter XPath DetailsInfo Splitting can be set only on root or record levels. You cannot split on an element level.
Click OK. This splits and sets the Splitter XPath on the selected source element.
Info Once a Splitter XPath is set for a source element, the letter (S) is displayed next to that source element. This signifies that the source element has been split and the Splitter XPath has been set. Refer to Table of Suffixes for details on suffixes displayed next to an element.
Once you have set a Splitter XPath, you can view it in the Output XML.Anchor _Toc226191069 _Toc226191069 Anchor _Toc315524649 _Toc315524649 Anchor _Toc315524921 _Toc315524921 Anchor _Toc344890232 _Toc344890232 Anchor _Toc385441562 _Toc385441562 Anchor _Toc387747401 _Toc387747401 Anchor _Toc387748674 _Toc387748674
Enabling Quick SplittingAnother way of splitting source data is to enable the quick splitting feature. This splits the source and sets the Splitter Xpath.Anchor _Toc401308971 _Toc401308971
Steps to split data by enabling quick splitting
...
Steps to view Splitter XPath
Click View menu and select View Mapping XML. The Mapping XML window is displayed. The Splitter XPath details are displayed with a $Input tag prefixed to Source XPath code (see Figure 468).
Figure 468: Splitter XPath in Mapping XML
You can remove a Splitter XPath that has been set for a source element.
Steps to remove Splitter XPath
...
Once you have split the source data by setting the Splitter XPath on a source element, you need to merge the split data at the target end. For this, you need to set the Merger XPath on a target element.
Setting the Merger XPath is largely dependent upon the Splitter XPath. You need to ensure that the number of Splitter XPaths and the Merger XPaths at the source and target schemas respectively are the same.
Steps to set Merger XPath
- Ensure that all the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Ensure that a Splitter XPath has been set for a source schema element.
Right-click the target schema element on which you want to merge the split data and select the Set as Merger XPath option. A screen showing the Merger XPath details is displayed (see Figure 470).
Figure 470: Merger XPath DetailsInfo Merging can be set only on root or record levels. You cannot merge on an element level.
Click OK. This merges the split data and sets the Merger XPath on the selected target element.
Info Once a Merger XPath is set for a target element, the letter (S) is displayed next to that target element. This signifies that the split data has been merged on the target element and the Merger XPath has been set. Refer to Table of Suffixes for details on suffixes displayed next to an element.
Info You can view Merger XPath details in the output XML. A $ input tag is prefixed to the line containing the Splitter XPath details.
Info When using Enable Quick Splitting feature, the Merger Xpath is also automatically set when this feature is selected.
- Once you have set a Merger XPath, you can view it in the Output XML.
...
You can remove mapping associated with a particular element.
Steps to remove mapping of a particular element
- Ensure that all the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Right-click the target element whose mapping you want to remove and select the Remove Mappings option.
The Remove Options window is displayed (see Figure 473).
Figure 473: Remove Options (Particular Element)This screen displays a list of properties and variables associated with the selected element that can be removed with the mapping.
Info Only the Remove Mapping is displayed as always enabled. The other options are enabled only if they have been defined for the particular element.
- Select the checkbox(s) of the options that you want to remove and click OK button. All the selected options and mapping associated with the particular element will be removed.
...
First of all you need to create context schema definition. Context schema definition contains name of the context variable that you want to map to other element. While creating context schema definition, you can create context variables or you can import it from the process flow within which you want to use this mapping activity.
Steps to create Context Schema Definition
In Data Mapper applet, from the Action menu and select Create Context Schema Definition. The Create Context Schema Definition Dialog window is displayed ( see Figure 474 ).
Figure 474: Create Context Schema
Info Only the Remove Mapping is displayed as always enabled. The other options are enabled only if they have been defined for the particular element.
- To add a context variable click Add button and enter the name of the variable.
Repeat the same steps to create other variables (see Figure 475 ).
Figure 475: Add Variables
You can also import the context variables of the process flow in which you want to use this mapping activity. To import context variables from process flow, click Import From Process Flow button. Import Context Variable dialog box is displayed (see Figure 476 )
Figure 476: Import Context Variables
- Select the process flow, from which you want to import context variables and click Load.
- Click Save.
...
Once you have created the context schema, you need to load it at source or target end depending on your need.
Steps to Load Context Schema Definition
...
Once you created the mapping activity using context schema you need to changes its streaming properties while creating process flow using this mapping activity.
If Context Schema is loaded at source side then there is no need to provide the source (dummy source) stream to the Mapping activity. Similarly if Context schema is loaded at target side then Mapping activity will not generate any output stream, so there is no need to attach dummy target. To achieve this Generate Stream and Consume Stream property has been added to Data Mapper activity in the Process Designer. User can disable these properties based on whether Context schema is loaded at source or target side.
Steps to disable input and output stream of mapping activity
...
You can use the required sub-function of Math mapping function to map elements. The process of using the Math function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.
Steps to map elements using the 'Division' Math Mapping Function
...
You can use the required sub-function of String mapping function to map elements. The process of using the String function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.
Steps to map elements using the 'Concat' String Mapping Function
...
You can use the required sub-function of Date mapping function to map elements. The process of using the Date function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.
Steps to map elements using the 'Date-Difference' Date Mapping Function
...
You can use the required sub-function of Aggregation mapping function to map elements. The process of using the Aggregation function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.
Steps to map elements using the 'Sum' Aggregation Mapping Function
...
You can use the required sub-function of Conditional mapping function to map elements. The process of using the Conditional function is the same for all its sub-functions. Thus, the mapping process using one sub- function is outlined below.
Anchor | ||||
---|---|---|---|---|
|
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Ensure that the source and target elements to be mapped are selected and displayed in the Mapping Graph Area.
- Click Boolean function menu and then select the >=Greater than Equal operator. A >= node is displayed in the Mapping Graph Area (see Figure 490).
Figure 490: Add Greater Than or Equal To Boolean Function NodeInfo To learn more about Boolean Functions, refer to the section Using Boolean Functions.
- Add a constant value in the Mapping Graph Area.
- Create a link from the output of the source element to the first input of the >= operator node.
Create a link from the output of the Constant node to the second input of the >= operator node (see Figure 491).
Figure 491: Create Links between Nodes for Mapping Elements using Greater Than Equal To Function
Click Conditional mapping function and select IF CONDITION sub-function. Further select For Mapping to Elements option. An IF CONDITION node is displayed in the Mapping Graph Area (see Figure 492).
Figure 492: Add IF Conditional Function Node
- Create a link from the output of the >= operator element to the first input of the IF CONDITION node.
- Add a constant value of integer type (for example, 25) in the Mapping Graph Area.
- Create a link from the output of the Constant element to the second input of the IF CONDITION node.
- Create a link from the output of the IF CONDITION node to the input of the target element node (see Figure 493).
Figure 493: Creating Links between Nodes for Mapping Elements using IF Conditional FunctionInfo If the value of SALARY element in the source data is greater than or equal to 5000, output will be 3000. If the value of TESTCASENO element in the source data is less than 100, output will be an empty tag.
Click Apply Mapping ( ) button. This maps elements using IF CONDITION function. A line is displayed between source and target panels showing the mapping of the source element to the target element.
Info This function simply filters the records based on the specified Boolean condition, but it does not create a data stream of the filtered records. You need to explicitly create the filtered data stream by creating another mapping (or adding same output schema in Target Panel) and using the IFF CONDITION () function based on the opposite Boolean condition.
Anchor _Toc88470441 _Toc88470441 Anchor axisfunction axisfunction Anchor _Toc131572384 _Toc131572384 Anchor _Toc134848123 _Toc134848123 Anchor _Toc144023047 _Toc144023047 Anchor _Toc144314293 _Toc144314293 Anchor _Toc177977135 _Toc177977135 Anchor _Toc226191080 _Toc226191080 Anchor _Toc315524665 _Toc315524665
Using Axis FunctionAnchor _Toc315524937 _Toc315524937 The Axis function contains a list of advance XSL functions that are used to map elements only when the For Each function is applied on the Target node. It comprises of various sub-functions, which are listed in the table below.
Anchor _Toc144313783 _Toc144313783 Anchor _Toc144827061 _Toc144827061 Anchor _Toc156195265 _Toc156195265 Anchor _Toc177878242 _Toc177878242 Anchor _Toc208651138 _Toc208651138
Table 18: Sub-Functions of Axis Mapping FunctionAnchor _Toc315524517 _Toc315524517 Mapping Function
Sub-Functions
Description
Example
Axis
File Path – XPath
This is a customized mapping function.
This is an XML Lookup which returns the value of the element/attribute within the XML file whose path is specified. The File path and XPath must be specified in single quotes.FilePath ['C:/correct_file.xml'] XPath {'/employees/employee/Name'}
Returns value of Name element from the file correct_file.xml.Self
Returns the element which is the context node itself.
Self::Employee
Returns Employee which is the context node itself.Child
Returns the element which is the child of the context node.
Child::Name
Returns Name which is a child of the context node.Parent
Returns the element, which is the parent (if any) of the context node.
Parent::Name
Returns Name which is a parent of the context node.Following-sibling
This axis contains all the following siblings of the context node. It returns the first occurrence of the element/attribute in the next sibling of the context node. If the context node is an attribute node or namespace node, then this axis is empty.
following-sibling: employee/Name
Returns the first occurrence of Name in the next employee node.Ancestor
Returns the element which is the ancestor of the context node. This axis always includes the root node, unless the context node is the root node.
Ancestor::Name
Returns Name which is an ancestor of the context node.Ancestor-or-self
This axis contains the context node and the ancestors of the context node. It always includes the root node. It returns the context node or ancestors of the context node.
ancestor-or-self::employees/@val
Returns context node or ancestors of context node.Preceding-sibling
This axis contains all the preceding siblings of the context node. It returns the first occurrence of the element/attribute in the preceding sibling of the context node. If the context node is an attribute node or namespace node, then this axis is empty.
preceding-sibling: employee/Name
Returns the first occurrence of Name in the previous employee node.Descendant
Returns the element which is the descendant of the context node. This axis does not contain attribute nodes.
descendant::Name
Returns Name, which is a descendant of the context node.Descendant-or-self
This axis contains the context node and the descendants of the context node. It returns the context node or descendants of the context node.
descendant-or-self::employees/salary
Returns context node or descendants of context node.Generate-id
Generates a unique id for the element/attribute specified by the XPath argument.
generate-id (employees/employee/Name)
Returns unique ID for Name elementCurrent
Removes all tags from the specified xml file and returns the data.
current()
Returns data of the xml file without tags.
You can use the required sub-function of Axis mapping function to map elements. The process of using the Axis function is the same for all its sub-functions.Anchor _Toc86096301 _Toc86096301 Anchor _Toc88470442 _Toc88470442 Anchor _Hlt97024182 _Hlt97024182 Anchor _Hlt113171947 _Hlt113171947 Anchor _Hlt113171950 _Hlt113171950 Anchor _Hlt118000374 _Hlt118000374 Anchor booleanfunction booleanfunction Anchor _Toc134848124 _Toc134848124 Anchor _Toc144023048 _Toc144023048 Anchor _Toc144314294 _Toc144314294 Anchor _Toc177977136 _Toc177977136 Anchor _Toc226191081 _Toc226191081 Anchor _Toc315524666 _Toc315524666
Using Boolean FunctionAnchor _Toc315524938 _Toc315524938 The Boolean mapping function enables you to map elements by applying various logical operators in building Boolean expressions. It comprises of various sub-functions, which are listed in the table below.
Anchor _Toc156195266 _Toc156195266 Anchor _Toc177878243 _Toc177878243 Anchor _Toc208651139 _Toc208651139
Table 19: Sub-Functions of Boolean Mapping FunctionAnchor _Toc315524518 _Toc315524518 Mapping Function
Sub-Functions
Description
Example
Boolean
Equal
Returns TRUE the first variable argument is equal to the second variable argument.
(5) = (5) returns true
Not Equal
Returns TRUE the first variable argument is not equal to the second variable argument.
(5) != (50) returns true
Greater Than
Returns TRUE the first variable argument is greater than the second variable argument.
(5)> (3) returns true
Less Than
Returns TRUE the first variable argument is less than the second variable argument.
(5) < (8) returns true
Greater than Equal
Returns TRUE the first variable argument is greater than or equal to the second variable argument.
(5)>= (5) returns true
(5)>= (3) returns trueLess than Equal
Returns TRUE the first variable argument is less than or equal to the second variable argument.
(5) <= (8) returns true
(5) <= (5) returns trueOr
Returns TRUE if either of the two variable arguments evaluate to TRUE otherwise FALSE. These variable arguments can only be of Boolean data type. Hence, their value can either be TRUE or FALSE only.
(True) Or (True) returns true
(True) Or (False) returns trueAnd
Returns TRUE if both of the two variable arguments evaluate to TRUE otherwise FALSE. These variable arguments can only be of Boolean data type. Hence, their value can either be TRUE or FALSE only.
(True) And (True) returns true
(True) And (False) returns false
A Boolean sub-function is always used in conjunction with a Conditional function. Thus for the process of using the Boolean function, refer to Steps to map elements using the IF Conditional Mapping Function.Anchor _Toc88470443 _Toc88470443 Anchor contextfunction contextfunction Anchor _Toc131572385 _Toc131572385 Anchor _Toc134848125 _Toc134848125 Anchor _Toc144023049 _Toc144023049 Anchor _Toc144314295 _Toc144314295 Anchor _Toc177977137 _Toc177977137 Anchor _Toc226191082 _Toc226191082 Anchor _Toc315524667 _Toc315524667
Using Context FunctionsAnchor _Toc315524939 _Toc315524939 The Context mapping function enables you to map elements by setting or getting value of process flow context variables.
It comprises of various sub-functions, which are listed in the table below.Anchor _Toc122847169 _Toc122847169 Anchor _Toc144313784 _Toc144313784 Anchor _Toc144827062 _Toc144827062 Anchor _Toc156195267 _Toc156195267 Anchor _Toc177878244 _Toc177878244 Anchor _Toc208651140 _Toc208651140
Table 20: Sub-Functions of Context Mapping FunctionAnchor _Toc315524519 _Toc315524519 Mapping Function
Sub-Functions
Description
Example
Context
Set-Context
This is a customized mapping function.
Sets the value of the specified variable argument in the process flow context. This value can be string constant, numeric constant, XPath or output of limited set of mapping function, which can be used before set-context function.
This function does not return a value. If mapped to a target element, it creates an empty tag of that target element in output XML.
set-context ('index', '123')
sets the value of index variable as 123 in the process flow.Get-Context
This is a customized mapping function.
Returns the value of the specified variable argument from process flow Context. This value can be string constant, numeric constant, XPath or output of limited set of mapping function. If no value has been set, then the value specified in the second argument is returned.get-context ('index', '100')
Returns the value of index variable from the process flow. If no value has been set for index, then 100 is returned.
In get-context function you can also use any variable, which is not declared. In such case get-context creates a variable with the specified name and value, which can be further used with the selected target element. This can be done only in Textual Rule panel.
You can use the Set-Context sub-function of Context mapping function to set value of the process flow variable and send it to the Process Designer. The Get-Context sub-function is used to return the value of the process flow variable.Using Set-Context Function
You can use the Set-Context Function in various ways. These are outlined as:
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Steps to pass output of mapping function or condition to a local variable
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Select the target element that you want to map with Set-Context function.
Click Context mapping function menu and select Set-Context sub-function. A set-context node is displayed in the Mapping Graph Area (see Figure 498).
Figure 498: Set-Context Node
- Add a constant node with the name of variable (e.g. index), whose value is to be set in the process flow context.
- Create a link from the output of the constant node (index) to the first input of the set-context node.
Add another constant node for the second argument (e.g. 100) of the set-context function.
Info Second argument can be string constant, integer constant, XPath, local variable or output of limited set of mapping function, which can be used before Set-Context function.
- Create a link from the output of second constant node (100) to the second input of the set-context node.
Create a link from the output of the set-context node to the target element (see Figure 499).
Figure 499: Create Links between Nodes for Mapping Set-Context Function to Target Element
- Click the Apply Mapping ( ) button. This maps the Set-Context function to the target element. The defined variable (index) is passed to the process flow with the value 100. If you shift focus to another node, or click any of the Mapping Rules, Textual Rules, Node, Properties, XSL or Debugger tabs, without applying the mapping, an alert message is displayed (refer to Figure 522).
Click No to apply the mapping and shift focus to the other object. If you click Yes, then the mapping activity is cleared and is replaced by the previous mapping in the Mapping Graph Area and the focus is shifted to the other object.
Info At times the mapping is too large and the applet memory may exceed 256M. In such cases, the mapping will fail and return an error of insufficient memory. You can overcome this situation by increasing the applet memory. For details, refer to Appendix A in the Administrator Guide.
Anchor _Toc125446729 _Toc125446729 Anchor _Toc131572389 _Toc131572389 Anchor _Toc134848129 _Toc134848129 Anchor usingDBfunction usingDBfunction Anchor _Toc177977138 _Toc177977138 Anchor _Hlt184625530 _Hlt184625530 Anchor _Toc226191083 _Toc226191083 Anchor _Toc315524668 _Toc315524668 Anchor _Toc315524940 _Toc315524940 Anchor _Toc385441568 _Toc385441568 Anchor _Toc387747407 _Toc387747407 Anchor _Toc387748680 _Toc387748680
Using DB FunctionAnchor _Toc401308977 _Toc401308977 The DB function enables you to get data from the database, based on a condition. It comprises of a sub-function, which is listed in the table below.
Anchor _Toc177878245 _Toc177878245 Anchor _Toc208651141 _Toc208651141
Table 21: Sub-Function of DB Mapping FunctionAnchor _Toc315524520 _Toc315524520 Mapping Function
Sub-Functions
Description
Example
DB
DBQuery
Returns data from the database, based on a query.
DBQuery( 'select EmpID from EMP where EMPID=1035', var1, 'true') returns all the records from the EMP table, where EMPID is 1035.
Here, 'var1' is the Connection Info variable.
If you change the last boolean argument from true to false, only the first record is returned.PreparedQuery
Returns data from the database, based on a query.
PreparedQuery ('SELECT EMPID FROM EMP WHERE EMPNAME=? AND EMPCITY=? AND EMPISMALE=?, $oracle_databaseserver, true ,('Smith','Chicago','true')').
Here, '=?' is the variable name that you pass in the braces.
The '$oracle_databaseserver' is the name of the Connection Info variable.
If you change the last boolean argument from true to false, only the first record is returned.
You can use this sub-function of DB mapping function to get data from the database. The process of using this sub-function is outlined below.Steps to get data from the database using the 'DBQuery' DB Mapping Function
...
Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
Ensure that a Connection Info variable is created for the PreparedQuery and is listed in the Parameters Panel.
Info For details on creating a Connection Info variable, refer to the Declaring Connection Info Variable section.
- Double-click the target element that you want to map with the PreparedQuery. It is displayed in the Mapping Graph Area.
Click the DB function and select the PreparedQuery sub-function. A PreparedQuery node is displayed in the Mapping Graph Area (see Figure 503).
Figure 503: Add PreparedQuery Sub-Function Node
- Add a constant node with the query for searching data from the database based on the specified condition (e.g. Select EMPID from EMP where EMPNAME=? AND EMPCITY=? AND EMPISMALE=?, $oracle_databaseserver, true ,('Smith','Chicago','true')).
- Create a link from the output of the constant node to the first input of the PreparedQuery node.
Double-click the required Connection Info variable under Connection Info in the Parameters Panel. The selected Connection Info variable node is displayed in the Mapping Graph Area (see Figure 504).
Figure 504: Connection Info Variable in Mapping Graph Area
- Create a link from the output of the Connection Info variable to the second input of the PreparedQuery node.
- Add another constant node for the third argument of the PreparedQuery function. This is a Boolean value as true or false.
- In the fourth argument of the PreparedQuery function you can pass values through either as a variable, or as a constant, or as a xpath.
- Create a link from the output of this constant node to the third input of the PreparedQuery node.
Create a link from the output of the PreparedQuery node to the input of the target element (see Figure 505).
Figure 505: Create Links between Nodes for Mapping PreparedQuery Function to Target Element
Click the Apply Mapping ( ) button. This maps the PreparedQuery function to the target element. The defined query is passed to the database where a connection is created using the Connection Info variable. If the Boolean value is set as 'True' then the database fetches all the values that match the query. If the value is 'False', then the database fetches only the first matching value. If you shift focus to another node, or click any of the Mapping Rules, Textual Rules, Node, Properties, XSL or Debugger tabs, without applying the mapping, an alert message is displayed (see Figure 506).
Figure 506: Mapper WarningClick No to apply the mapping and shift focus to the other object. If you click Yes, then the mapping activity is cleared and is replaced by the previous mapping in the Mapping Graph Area and the focus is shifted to the other object.
Info At times the mapping is too large and the applet memory may exceed 256M. In such cases, the mapping will fail and return an error of insufficient memory. You can overcome this situation by increasing the applet memory. For details, refer to Appendix A in Administrator Guide.
Anchor _Toc177977139 _Toc177977139 Anchor _Toc184405107 _Toc184405107 Anchor _Toc226191084 _Toc226191084 Anchor _Toc315524669 _Toc315524669 Anchor _Toc315524941 _Toc315524941 Anchor _Toc344890238 _Toc344890238 Anchor _Toc385441569 _Toc385441569 Anchor _Toc387747408 _Toc387747408 Anchor _Toc387748681 _Toc387748681
Using Textual RulesTextual Rules are used for mapping source elements, mapping functions or constants to target elements, by defining the elements in syntax form.Anchor _Toc401308978 _Toc401308978
Steps to map elements using the Concat function using Textual Rules
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Select the target element that you want to map. It is displayed in the Mapping Graph Area.
- Click the Textual Rules tab in the Mapping Graph Area.
Click String mapping function and select Concat sub-function. The syntax for the Concat sub-function is displayed in the Mapping Graph Area (see Figure 507).
Figure 507: Syntax for Concat Sub-Function
This syntax has two parameters. Double-click a source element that you want to set as the first parameter. This displays the selected source element in the syntax.
Similarly, double-click another source element as the second parameter. This is displayed in the syntax (see Figure 508).Figure 508: Parameters of the Concat Syntax
Info You can indent the textual rule content as per your requirement.
- Click the Apply Mapping ( ) button. This maps elements using the concat sub-function. A line is displayed between the source and target panels showing the mapping of the source element to the target element.
...
Namespace allows you to add, view, edit, and remove the namespace in the XSL. All the Namespaces present in the source and target XSD's are automatically placed in the XSL generated. These Namespaces can be viewed using View Namespace option in the Namespace submenu.
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Steps to add a Namespace in the XSL
...
- Click XSL Template option displayed next to mapping functions on the Mapping Functions Panel.
Select Manage XSL Template option or click the Manage XSL Template icon in the toolbar (Figure 511).
Figure 511: Data Mapper
The Manage XSL Template screen is displayed (see Figure 512).
Figure 512: Manage XSL Template
- Enter the name of the new XSL template that you want to create in the Name field. This displays the XSL tags in the XSL Template area.
Select the scope of the XSl Template. The default scope of an XSl Template is Local.
Info If you want to save the template as the Global Template, select the Global radio button. This will save the XSL template as Global XSL template and can be used in any mapping activity. In the Parameters panel, the XSL template will be displayed under the folder hierarchy Templates/Global.
If you want to save the template within the current user group, select the Group radio button. This will save the XSL template as Group XSL template and can be used in any mapping activity within the current user group. In the Parameters panel, the XSL template will be displayed under the folder hierarchy Templates/Group.Info You cannot change the scope of a XSL Template once you have saved the XSL template. The respective radio buttons become non-editable thereafter.
- Click the Add button to add parameters for the new XSL template.
- Enter the name of the parameter you want to add in the Name field. It also generates the corresponding XSL in the XSL Template editor on the Manage XSL Template screen
Click the Add icon again to add the required parameters or press the Enter key to insert a new row. This will add a row immediately next to the row which is currently selected (see Figure 513).
Figure 513: Manage XSL Template: XSL RulesInfo If you need to delete any row, select the respective row and click the Delete icon.
Info You can also define variables as the parameters of the XSL Template. To add a global variable, refer to the section Using Global Variable.
- Enter the code for the function that you want to perform, for example, addition of two numbers, in the 'add here' line, in the XSL Template field. The syntax of the addition function would be:
<xsl:value-of select ="$param1 + $param2"/>
where:
value-of is the syntax for the value to be returned
param1 and param 2 are the defined parameters - Once you have entered the code, click Local XSL template. This displays the saved template under the Templates list on the XSL Template screen. The new XSL template is also displayed under Templates in the Parameters Panel (see Figure 514).
...
Once you have created a XSL template, you can use it to map elements. On the Manage XSL Template screen, by default the XSL Rules tab is selected. To create a XSL template using the Mapping Rules, click the Mapping Rules tab.
Steps to create an XSL template using the XSL Rules
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Steps to declare a Global Variable
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click the Global tab in the Mapping Graph Area. All tabs of the Global tab are displayed.
Click the Global Variables tab. The Global Variable pane is displayed in the Mapping Graph Area (see Figure 520).
Figure 520: Global Variable Pane- Click the Global Variable Name text field and enter the name of the global variable you want to create (e.g. emp_age). Press the Tab or Enter key. This takes the control to the Global Variable Value field.
- Enter the value of the global variable in the Global Variable Value field. You can enter the value of the global variable using one of the listed methods:
- Click required source element
- Select the required Mapping function
- Type the required value manually
Select a Custom Method
Info To select a Custom Method as the value of a global variable, double click the desired Custom Method under Custom Methods in the Parameters Panel. The selected Custom Method is displayed in the Variable Definition field.
To learn how to declare a Custom Method, refer to section Using Custom Method.
Enter comments for the global variable in the Add Comment field (see Figure 521). For example, if the global variable value contains complex XSLT logic, you can enter its description in this field.
Info The Comments field is resizable.
Figure 521: Enter Name, Value and Comments of Global VariableClick Save Global Variable ( ) button to save the global variable. This global variable is added to the list of existing variables in the Global Variable Name field. It is also displayed under Global Variables in the Parameters Panel. If you shift the focus to another node, or click any of the Mapping Rules, Textual Rules, Local Variables, Properties, XSL or Debugger tabs, without saving the global variable, an alert message is displayed. (see Figure 522). The comments added for the global variable are saved and displayed above the global variable declaration in the Mapping XSL (refer to Figure 523).
Figure 522: Alert MessageInfo For example, you have defined a global variable Var1, and you click the Name target element, without saving Var1, then the alert message is displayed.
The alert message is also displayed when shifting focus between Global and Node tabs.- Click No to save the global variable and shift the focus to the other object. If you click Yes, then the defined global variable is cleared and the focus is shifted to the other object.
Figure 523: Comment in Mapping XSL
...
Anchor | ||||
---|---|---|---|---|
|
Once the global variable is added to the Parameters Panel, you can edit it or delete it anytime from this Panel itself.
Steps to manage a Global Variable from the Parameters Panel
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Map Global Variable to Target Element
Once you have created a global variable, you can map it to a target element.
Steps to map Global Variable to target element
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed.
Click the Local Variables tab. The Local Variable pane is displayed in the Mapping Graph Area (see Figure 527).
Figure 527: Local Variable Pane
Click Local Variable Name text field and enter the name of the local variable you want to create (e.g. varQuery). Press the Tab or Enter key. This takes the control to the Local Variable Value field.Anchor _Hlt123365871 _Hlt123365871
Enter the value of the local variable in the Local Variable Value field. You can enter the value of the local variable using one of the listed methods:Anchor _Hlt123365869 _Hlt123365869
- Click required source element
- Select the required Mapping function
- Type the required value manually
- Select a Custom Method
Enter comments for the local variable in the Add Comment field (see Figure 528). For example, if the local variable value contains complex XSLT logic, you can enter its description in this field.
Info The Comments field is resizable.
Figure 528: Enter Name, Value and Comment for Local VariableInfo To select a Custom Method as the value of a local variable, double click the desired Custom Method under Custom Methods in the Parameters Panel. The selected Custom Method is displayed in the Variable Definition field.
To learn how to declare a Custom Method, refer to section Using Custom Method.Click the Save Local Variable ( ) button to save the local variable for the selected target element. This local variable is added to the list of existing variables in the Local Variable Name field. It is also displayed under Local Variables in the Parameters Panel. If you shift the focus to another node, or click any of the Mapping Rules, Textual Rules, Global Variables, Properties, XSL or Debugger tabs, without saving the local variable, an alert message is displayed (refer to alertmsg Figure 522). The comments added for the local variable are saved and displayed above the local variable declaration in the Mapping XSL (refer to Figure 523).
Info The alert message is also displayed when shifting focus between Global and Node tabs.
Click No to save the local variable and shift the focus to the other object. If you click Yes, then the defined local variable is cleared and the focus is shifted to the other object.
Info Once the local variable is saved, it is categorized as Current Variable or Ancestor Variable in the Parameters Panel. If it is created for a child node, then it is saved as a Current Variable. If it is created for a parent's parent node, then it is saved as an Ancestor Variable.
Info You can rearrange the local variables by dragging it up or down in the list.
Steps to manage a Local Variable from the Parameters Panel
- Right-click the local variable that you want to edit or delete. This displays the right dropdown menu.
Select Edit to edit the variable. This displays the selected local variable in Edit mode. You can edit the value of the local variable in the Local Variable Value field. You can also edit the name of the local variable in the Local VariableName field (see Figure 529).
Figure 529: Edit Name, Value and Comment for Local Variable
Click the Save Local Variable ( ) button to save the edited local variable. An alert message is displayed.
Figure 530: Alert Message
Click OK to save the changes.
Info To remove a local variable, select the local variable and click Remove selected local variable ( ) button.
To remove all local variables, click Remove all local variables ( ) button.
Alternately, you can delete a local variable from the Parameters Panel itself. For details, refer to the Managing a Global Variable from Parameter Panel section.Anchor _Toc131572405 _Toc131572405
Map Local Variable to Target ElementAnchor _Toc134848145 _Toc134848145
Once you have created a local variable, you can map it to the specific target element or attribute.Steps to map Local Variable to specific target element
...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Once you have created a custom method, you can map it to a target element.
Steps to map Custom Method to target element
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed. Click Mapping Rules tab.
- Select a target element. This displays the selected target element node in the Mapping Graph Area.
Double-click the required custom method under Custom Methods in the Parameters Panel. The selected method node is displayed in the Mapping Graph Area (see Figure 536).
Info If the custom method is defined with more than 4 parameters, then double-clicking the custom method will display the warning message (refer to Figure 534). Once you click OK, you need to define the mapping using Textual Rules.
Figure 536: Add Custom Method Node
- Click two source elements. The selected source nodes are displayed in the Mapping Graph Area.
- Create a link from the output of the first source element to the first input of the custom method node.
- Create a link from the output of the second source element to the second input of the custom method node.
Create a link from the output of the custom method node to the input of the target element (see Figure 537).
Figure 537: Create Links between Nodes
- Click the Apply Mapping ( ) button. This maps the custom method to the target element.
Save the mapping activity and exit the Data Mapper.
Info You can view and validate the generated mapping XSL, view the target XML and view and validate mapping output, before saving the mapping activity.
Anchor _Toc177977149 _Toc177977149 Anchor _Toc184405113 _Toc184405113 Anchor _Toc226191094 _Toc226191094 Anchor _Toc315524679 _Toc315524679 Anchor _Toc315524951 _Toc315524951 Anchor _Toc344890244 _Toc344890244 Anchor _Toc385441575 _Toc385441575 Anchor _Toc387747414 _Toc387747414 Anchor _Toc387748687 _Toc387748687
Dynamically Loading Custom MethodsAdeptia supports dynamic loading of custom methods in the Data Mapper. It loads the custom methods available in the Custom Classes folder, under the Global Methods node in the Parameters Panel. This enables you to access any custom method from the Data Mapper itself, without any need to specify method parameters, such as class name, method name and the number of arguments in the Data Mapper applet.Anchor _Toc401308984 _Toc401308984
Steps to dynamically load Custom Methods
Figure 536: Add Custom Method Node
Copy all the class files in the Custom Classes folder and then restart the kernel.
Info The current implementation of Global Methods does not support package hierarchy. So all class files that are directly placed in the Custom Classes folder, will be visible through the Global Methods node in the Parameters Panel. Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes. The Global Methods node is already displayed in the Parameters Panel, each time Data Mapper is opened (see Figure 538).
Figure 538: Global Methods NodeExpand the Global Methods node to display all the class files present in the Custom Classes folder (see Figure 539).
Figure 539: List of Class Files in Custom Classes Folder- Expand a class node to display all custom methods available for that class (see Figure 540).
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click the Global tab in the Mapping Graph Area. All tabs of the Global tab are displayed.
Click the Connection Info tab. The Connection Info Variable pane is displayed in the Mapping Graph Area (see Figure 546).
Figure 546: Connection Info Variable Pane
- Click the Connection Variable Name text field and enter the name of the Connection Info variable you want to create (e.g. Var1). Press the Tab or Enter key. This takes the control to the Connection Variable Value field.
- The Connection Info variable accepts a DBInfo as its value. Thus, the Connection Variable Value field displays a list of existing DBInfo Names and their IDs.
Select the DBInfo name that you want to assign for the Connection Info variable (see Figure 547).
Figure 547: Enter Connection Variable ValueInfo You can click Synchronize to reload the DBInfo list.
Figure 547: Enter Connection Variable Value
- Click the Save Connection Variable ( ) button to save the Connection Info variable. This Connection Info variable is added to the list of existing variables in the Connection Variable Name field. It is also displayed under Connection Info in the Parameters Panel. If you shift the focus to another node, or click any of the Mapping Rules, Textual Rules, Local Variables, Properties, XSL or Debugger tabs, without saving the Connection Info variable, an alert
message is displayed (refer to Figure 522).Anchor _Hlt238278196 _Hlt238278196 Click No to save the Connection Info variable and shift the focus to the other object. If you click Yes, then the defined Connection Info variable is cleared and the focus is shifted to the other object.
Info You can rearrange the Connection Info variables by dragging it up or down in the list.
Info You can edit or delete a Connection Info variable from the Parameters Panel itself. For details, refer to the Managing a Global Variable from Parameter Panel section.
Anchor _Toc177977153 _Toc177977153 Anchor _Toc184405117 _Toc184405117 Anchor _Setting_Target_Element _Setting_Target_Element Anchor _Toc226191099 _Toc226191099 Anchor _Toc315524685 _Toc315524685 Anchor _Toc315524957 _Toc315524957 Anchor _Toc344890249 _Toc344890249 Anchor _Toc385441580 _Toc385441580 Anchor _Toc387747419 _Toc387747419 Anchor _Toc387748692 _Toc387748692
Setting Target Element PropertiesYou can set various properties of a target element.Anchor _Toc401308989 _Toc401308989
Steps to set target element properties
...
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click the target element for which you want to set the For Each property.
- Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed.
- Click Properties tab. The Properties pane is displayed (refer to Figure 548).
Click the For Each property field and then double-click the source element using which you want to apply the For Each property. This displays the entire path of the source element in the For Each field (see Figure 549).
Figure 549: Source Element in For Each PropertyInfo You can set the For Each property on more than one source element. You can use the character as a separator between the XPath of each source element.
- Click Save Properties. This applies the For Each property for the selected target element. If you shift focus to another node, or click any of the Mapping Rules, Textual Rules, Global Variables, Properties, XSL or Debugger tabs, without saving the For Each property, an alert message is displayed (refer to Figure 522).
Click No to save the For Each property and shift focus to the other object. If you click Yes, then the defined For Each property is cleared and the focus is shifted to the other object.
Info Once the For Each property is applied to a target element, the letter (F) is displayed next to the target element. Refer to Table of Suffixes for details on suffixes displayed next to a target element.
Info To remove the For Each property from the target element, right-click target element and select Remove Mappings option. This displays the Remove Mapping Options dialog box. Select the Remove For Each checkbox and click OK.
Anchor _Toc86096305 _Toc86096305 Anchor _Toc88470448 _Toc88470448 Anchor _Toc112820688 _Toc112820688 Anchor _Toc114994147 _Toc114994147 Anchor _Hlt118287913 _Hlt118287913 Anchor _Toc125446738 _Toc125446738 Anchor addcomments addcomments Anchor _Toc131572413 _Toc131572413 Anchor _Toc134848153 _Toc134848153 Anchor _Toc144023060 _Toc144023060 Anchor _Toc144314306 _Toc144314306 Anchor _Toc177977155 _Toc177977155 Anchor _Toc315524687 _Toc315524687 Anchor _Toc315524959 _Toc315524959 Anchor _Toc226191101 _Toc226191101
Adding Comments to Target Schema Elements
Comments are used to provide additional information to target nodes and elements. Comments are displayed as tool tips and are reflected in the XSL generated under the XSL tab.
Steps to add a comment to the target element
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Click the target element for which you want to add a comment.
- Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed.
- Click the Properties tab. The Properties pane is displayed (refer to Figure 548).
Click the Comments property field and enter the comment for the selected target element (see Figure 550).
Figure 550: Enter Comment
- Click Save Properties. This adds the comment and displays it next to the target element. If you shift focus to another node, or click any of the Mapping Rules, Textual Rules, Global Variables, Properties, XSL or Debugger tabs, without saving the comments, an alert message is displayed (refer to Figure 522).
Click No to save the comments and shift focus to the other object. If you click Yes, then the defined comments are cleared and the focus is shifted to the other object.
Info Once a comment is added to a target element, the letter (CM) is displayed next to the target element. This signifies that a comment has been created for the target element. Refer to Table of Suffixes for details on suffixes displayed next to a target element.
Anchor _Toc123365651 _Toc123365651 Anchor _Toc131271534 _Toc131271534 Anchor _Toc134263447 _Toc134263447 Anchor _Toc144312869 _Toc144312869 Anchor _Toc144313555 _Toc144313555 Anchor _Ref144629252 _Ref144629252 Anchor _Ref144733625 _Ref144733625 Anchor _Toc177976683 _Toc177976683 Anchor _Ref184623399 _Ref184623399 Anchor _Toc208650722 _Toc208650722 Anchor _Toc239872400 _Toc239872400 Anchor _Toc315524262 _Toc315524262
Figure 551: Sample Input XMLAnchor _Toc401308613 _Toc401308613 Anchor setsortingrules setsortingrules Anchor _Toc131572414 _Toc131572414 Anchor _Toc134848154 _Toc134848154 Anchor _Toc144023061 _Toc144023061 Anchor _Toc144314307 _Toc144314307 Anchor applysortingrules applysortingrules Anchor _Toc177977156 _Toc177977156 Anchor _Toc226191102 _Toc226191102 Anchor _Toc315524688 _Toc315524688
Setting Sorting RulesAnchor _Toc315524960 _Toc315524960
You can set sorting rules for a target element. It is used to sort value of elements in the generated output. While generating the output XML, the value of elements can be sorted either in ascending or descending order. For example, records of the employee can be sorted based on their salaries. Figure 551 shows input XML before sorting.<?xml version="1.0" encoding="UTF-8" ?>
- <employees>
- <employee attribute="14" attribute1="15">
<TESTCASENO>TESTCASENO1</TESTCASENO>
<DESCRIPTION>DESCRIPTION1</DESCRIPTION>
<NAME>John</NAME>
<ADDRESS>Address1</ADDRESS>
<EMAILID>EMAILID1</EMAILID>
<PHONENO>PHONENO1</PHONENO>
<DOB>DOB1</DOB>
<DEPT>DEPT1</DEPT>
<SALARY>10000</SALARY>
<DOJ>DOJ1</DOJ>
<DESIGNATION>DESIGNATION1</DESIGNATION>
<AGE>34</AGE>
</employee>
- <employee attribute="14" attribute1="15">
<TESTCASENO>TESTCASENO2</TESTCASENO>
<DESCRIPTION>DESCRIPTION2</DESCRIPTION>
<NAME>David</NAME>
<ADDRESS>ADDRESS2</ADDRESS>
<EMAILID>EMAILID2</EMAILID>
<PHONENO>PHONENO2</PHONENO>
<DOB>DOB2</DOB>
<DEPT>DEPT2</DEPT>
<SALARY>8000</SALARY>
<DOJ>DOJ2</DOJ>
<DESIGNATION>DESIGNATION2</DESIGNATION>
<AGE>45</AGE>
</employee>
- <employee attribute="14" attribute1="15">
<TESTCASENO>TESTCASEN3</TESTCASENO>
<DESCRIPTION>DESCRIPTION3</DESCRIPTION>
<NAME>Ricky</NAME>
<ADDRESS>ADDRESS3</ADDRESS>
<EMAILID>EMAILID3</EMAILID>
<PHONENO>PHONENO3</PHONENO>
<DOB>DOB3</DOB>
<DEPT>DEPT3</DEPT>
<SALARY>15000</SALARY>
<DOJ>DOJ3</DOJ>
<DESIGNATION>DESIGNATION3</DESIGNATION>
<AGE>36</AGE>
</employee>
</employees>Figure 552 shows the Output XML after sorting.
<?xml version="1.0" encoding="UTF-8" ?>Anchor outputxml outputxml
- <employees xmlns:java="http://xml.apache.org/xslt/java" xmlns:str="http://exslt.org/strings">
- <employee attribute="" attribute1="">
<TESTCASENO>TESTCASEN3</TESTCASENO>
<DESCRIPTION>DESCRIPTION3</DESCRIPTION>
<NAME>Ricky</NAME>
<ADDRESS>ADDRESS3</ADDRESS>
<EMAILID>EMAILID3</EMAILID>
<PHONENO>PHONENO3</PHONENO>
<DOB>DOB3</DOB>
<DEPT>DEPT3</DEPT>
<SALARY>15000</SALARY>
<DOJ>DOJ3</DOJ>
<DESIGNATION>DESIGNATION3</DESIGNATION>
<AGE>36</AGE>
</employee>
- <employee attribute="" attribute1="">
<TESTCASENO>TESTCASENO1</TESTCASENO>
<DESCRIPTION>DESCRIPTION1</DESCRIPTION>
<NAME>John</NAME>
<ADDRESS>Address1</ADDRESS>
<EMAILID>EMAILID1</EMAILID>
<PHONENO>PHONENO1</PHONENO>
<DOB>DOB1</DOB>
<DEPT>DEPT1</DEPT>
<SALARY>10000</SALARY>
<DOJ>DOJ1</DOJ>
<DESIGNATION>DESIGNATION1</DESIGNATION>
<AGE>34</AGE>
</employee>
- <employee attribute="" attribute1="">
<TESTCASENO>TESTCASENO2</TESTCASENO>
<DESCRIPTION>DESCRIPTION2</DESCRIPTION>
<NAME>David</NAME>
<ADDRESS>ADDRESS2</ADDRESS>
<EMAILID>EMAILID2</EMAILID>
<PHONENO>PHONENO2</PHONENO>
<DOB>DOB2</DOB>
<DEPT>DEPT2</DEPT>
<SALARY>8000</SALARY>
<DOJ>DOJ2</DOJ>
<DESIGNATION>DESIGNATION2</DESIGNATION>
<AGE>45</AGE>
</employee>
</employees>Anchor _Toc134263448 _Toc134263448 Anchor _Ref144022821 _Ref144022821 Anchor _Toc144312870 _Toc144312870 Anchor _Toc144313556 _Toc144313556 Anchor _Ref144733658 _Ref144733658 Anchor _Toc177976684 _Toc177976684 Anchor _Ref184623428 _Ref184623428 Anchor _Toc208650723 _Toc208650723 Anchor _Toc239872401 _Toc239872401 Anchor _Toc315524263 _Toc315524263
Figure 552: Output XMLAnchor _Toc401308614 _Toc401308614 Info The Sorting rules can be set only for record where For Each Mapping or Apply Template is used. The <xsl:apply-templates> element applies a template to the current element or to the child nodes of the current element, when the parent elements of source and target schemas are mapped.
Anchor _Hlt123365400 _Hlt123365400
Steps to set Sorting Rules
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Ensure that the source and target elements to be mapped are selected and displayed in the Mapping Graph Area.
To use Apply template, click Employee (parent) element in the source panel and drag the mouse pointer to the Employee (parent) element in the target panel. A line is displayed between the source and target panels indicating the mapping between source and target elements (see Figure 553).
Figure 553: Apply TemplateInfo To learn how to set For Each property on employee element refer to the section Setting For Each Property.
- Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed.
- Click the Properties tab. The Properties pane is displayed (refer to Figure 548).
- Click the Click here to add/view Sorting Rules option displayed against the Sorting property field. This displays the Add New Sorting Rules dialog box (see Figure 554).
Figure 554: Sorting Rules Dialog BoxThis screen displays the name of the selected target record to be sorted.
- Type the name of the source element on the basis of which you want to sort output (e.g. SALARY), in the Source Element field.
- Select the data type as either text or numeric from the Data Type dropdown list. This specifies how the input value is to be interpreted. By default, text is selected.
- Select the sorting order as ascending or descending from the Order dropdown list. By default, ascending is selected.
- Click Save to save the sorting rule.
Click Close to return the Data Mapper screen. The letter (SR) is displayed next to the sorted target element. This signifies that the target element has been sorted based on the specified source element. Refer to the[ Table of Suffixes|Using Data Mapper#suffixestable] for details on suffixes displayed next to an element.
Info More than one sorting can also be applied to a single target element. For example, if salary of two employees is same, they can be further sorted out based on their age.
To delete sorting, click View/Remove button. The Remove Sorting Rules dialog box is displayed with a list of existing sorting rules. Select sorting rule and click Remove/Remove All to delete sorting rules.
Once the sorting is applied based on the set rules, the output XML is displayed as displayed in Figure 552.Anchor _Toc88470449 _Toc88470449 Anchor _Toc112820689 _Toc112820689 Anchor _Toc114994148 _Toc114994148 Anchor _Toc125446739 _Toc125446739 Anchor _Toc131572415 _Toc131572415 Anchor _Toc134848155 _Toc134848155 Anchor _Toc144023062 _Toc144023062 Anchor _Toc144314308 _Toc144314308 Anchor _Toc177977157 _Toc177977157 Anchor _Toc184405118 _Toc184405118 Anchor _Toc226191103 _Toc226191103 Anchor _Toc315524689 _Toc315524689 Anchor _Toc315524961 _Toc315524961 Anchor _Toc344890250 _Toc344890250 Anchor _Toc385441581 _Toc385441581 Anchor _Toc387747420 _Toc387747420 Anchor _Toc387748693 _Toc387748693
Filtering of Elements/Attributes in Target DataYou can filter elements or attributes from appearing in the target XML. There are two ways to filter data:Anchor _Toc401308990 _Toc401308990 - Using IFF Condition
- Using Apply Filter checkbox from right-click popup menu
...
Info |
---|
The Apply Filter checkbox method is recommended as it is easy to use and can be done individually on multiple nodes, directly from the data mapper applet. |
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Steps to filter using Apply Filter Checkbox
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
Right-click the target element that you want to filter, and mark the Apply Filter checkbox as checked (see Figure 555). By default, this checkbox is disabled.
...
...
Figure 555: Checking Apply Filter Checkbox
This selection will filter the selected element from the target output XML data. You can uncheck this checkbox anytime to display the element in the target data.
Info You can apply this filtering option on the element or attribute levels.
Once the filter is applied on the target element, the letters (FL) are displayed next to each filtered target element. This signifies that the filter has been applied for the target element. Refer to Table of Suffixes for details on suffixes displayed next to an element.
Anchor _Toc177977159Toc344890251 _Toc177977159Toc344890251 Anchor _Toc184405119Toc385441582 _Toc184405119Toc385441582 Anchor _Toc226191105Toc387747421 _Toc226191105Toc387747421 Anchor _Toc315524691Toc387748694 _Toc315524691Toc387748694
Creating Clone of Target ElementAnchor _Toc315524963Toc401308991 _Toc315524963Toc401308991
Toc344890251Anchor _
Toc344890251Toc177977159 _ Toc177977159
Toc385441582Anchor _
Toc385441582Toc184405119 _ Toc184405119
Toc387747421Anchor _
Toc387747421Toc226191105 _ Toc226191105
Toc387748694Anchor _
Toc387748694Toc315524691 _ Toc315524691
Toc401308991Anchor _
Toc401308991Creating Clone of Target ElementToc315524963 _
Cloning means generating replicas of the target elements or nodes. You can create clones of all target elements.Toc315524963
Steps to create a clone
- Ensure that the the source and target schemas are loaded and and all their elements are listed under their respective nodes.
Right-click the target element and select the CloneNode option.
...
Info You can create a clone of all target nodes except the root node. Thus,
...
the Clone Node
...
sub-option is displayed as inactive for the root node.
...
- The element which is created using cloning is displayed with the suffix [1] after its name. Subsequent clones that are created for that element will have the suffix [2] and so on. You can create a maximum of 300 occurrences of an element, with one main element and 299 clones.
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Steps to remove a clone
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
Right-click the cloned element that you want to remove and select the Remove Clone option. A screen is displayed confirming the removal of the selected clone (see Figure 556).
...
Figure 556: Confirm Remove Clone
Click Yes to remove the clone. This removes the selected clone from the target schema.
Info If more than one clone has been created for an element, then you need to remove the clones in descending order.
Anchor _Toc131572417 _Toc131572417 Anchor _Toc134848157 _Toc134848157 Anchor _Toc144023064 _Toc144023064 Anchor _Toc144314310 _Toc144314310 Anchor _Toc177977161 _Toc177977161 Anchor _Toc184405120 _Toc184405120 Anchor _Toc226191107 _Toc226191107 Anchor _Toc315524693 _Toc315524693 Anchor _Toc315524965 _Toc315524965 Anchor removeschema removeschema Anchor _Toc344890252 _Toc344890252 Anchor _Toc385441583 _Toc385441583 Anchor _Toc387747422 _Toc387747422 Anchor _Toc387748695 _Toc387748695
Adding a Character Data ( CData) SectionAnchor _Toc401308992 _Toc401308992 The XML parsers normally parse the complete text in an XML document i.e., when an XML element is parsed, the text data between the XML tags is also parsed. Consider the following example:,
<message>This text will also be parsed</message>
In this example, the message between the <message> and </message> text will normally be parsed by the XML parser. Consider another example:
<name><first>Hello</first><last>User!</last></name>
In this example also, the XML parser will break the XML tags and parse the text data as Hello User!
The text data that is parsed by the XML parser is termed as Parsed Character Data or PCData.
However, the user may require to add some text data that should not be parsed by the XML parser. The Character Data or CData is the text data that should not be parsed by the XML parser. CData is also termed as Unparsed Data.
Adeptia Suite enables you to add a CData section with the target schema. The text data inside a CDATA section is ignored by the parser.
A CDATA section starts with "<![CDATA[" and ends with "]]>". CDATA sections are useful for writing XML code as text data within an XML document.Info A CDATA section cannot contain the string "]]>" and therefore it is not possible for a CDATA section to contain nested CDATA sections.
You can use multiple CDATA sections by splitting each occurrence of the "]]>"just before the ">".
Steps to add a CData section
- Ensure that the the source and target schemas are loaded and and all their elements are listed under their respective nodes.
Click Actions menu and select the option CData Section Elements (see Figure 559).
...
...
Figure 557: CData Section Elements
- The CData Section Elements dialog is displayed (see Figure 558).
...
Figure 558: CData Section Elements Dialog
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
You can remove a schema from the source or target panels. If a source or target schema is removed, everything associated with the mapping of the schema such as Mapping Graph Area, Connection Lines or For Each property is removed.
Steps to remove a schema
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
Right-click the root element of the schema that you want to remove and select the Remove Schema option. A screen is displayed confir
ming the removal of the selected schema (see Figure 559).Anchor _Hlt184625293 _Hlt184625293
...
...
Figure 559: Confirm Remove Schema
Click Yes to remove the schema. This removes the selected clone from the target schema.
Info A schema can be removed only from the root element. Thus, the Remove Schema option is displayed as active only for the root element.
Anchor _Toc177977162 _Toc177977162 Anchor _Toc184405121 _Toc184405121 Anchor _Toc226191108 _Toc226191108 Anchor _Toc315524694 _Toc315524694 Anchor _Toc315524966 _Toc315524966 Anchor _Toc344890254 _Toc344890254 Anchor _Toc385441585 _Toc385441585 Anchor _Toc387747424 _Toc387747424 Anchor _Toc387748697 _Toc387748697
Adding Custom XSLAt times, you may want to add some additional specialized XSL to a target element, or at the top or bottom of the mapping XSL. You can do this by adding custom XSL code.Anchor _Toc401308994 _Toc401308994
Steps to add custom XSL code for a Target Element
- Ensure that the the source and target schemas are loaded and and all their elements are listed under their respective nodes.
Right-click the target element and select the Custom XSL Before option (see Figure 560).
...
...
Figure 560: Select Custom XSL Before Option
The Add Custom XSL Before screen is displayed for the target element. Enter the custom XSL code for the target element (see Figure 561).
...
...
Figure 561: Enter Custom XSL Code
Click Save to save the XSL code and close the screen. Alternately, click Clear to clear the XSL code, or Cancel to close the screen without saving the changes.
Info Similarly, you can add custom XSL code after a target element, by selecting Custom XSL After option from the right menu (refer to Figure 560).
Anchor _Toc131572418 _Toc131572418 Anchor _Toc134848158 _Toc134848158 Anchor _Toc144023065 _Toc144023065 Anchor _Toc144314311 _Toc144314311
Steps to add global custom XSL code
- Ensure that the the source and target schemas are loaded and and all their elements are listed under their respective nodes.
Click the Actions menu and select Global Custom XSL Before option (see Figure 562).
...
...
Figure 562:
...
Select Global Custom XSL Before Option
The Add Global Custom XSL Before screen is displayed. Enter the global custom XSL code (see Figure 563).
...
Figure 563: Enter Global Custom XSL Code
Click Save to save the XSL code and close the screen. Alternately, click Clear to clear the XSL code, or Cancel to close the screen without saving the changes.
Info Similarly, you can add global custom XSL code after mapping XSL, by selecting Global Custom XSL After option from the Actions menu (refer to Select Global Custom XSL Before Option screen).
- Once you have entered the custom XSL code, it is saved in the Mapping XSL screen (see Figure 564).
...
You can change the root element when XML schemas are loaded. The root element always appears as a tag in the Output section on the Debugger screen. You can change this tag by selecting the desired root element.
Steps to select root element of a schema
- Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
- Right-click the root element of the schema whose root element you want to change and select the Select Root option.
- The Select Root Element screen is displayed.
- This screen displays a list of existing root elements for the selected schema in a dropdown list (see Figure 565).
Figure 565: Select Root ElementInfo All elements that are declared as global in the XSD are listed in this dropdown list.
Select the root element that you want to change from the Select Root dropdown list and click OK. A screen is displayed confirming the change of the root element (see Figure 566).
Figure 566: Confirm Change of Root Element- Click Yes to change the root element. This changes the root element and displays the selected root element.
...
You can add a namespace prefix to a target element. This prefix is displayed next to the target element in the target schema, and is automatically displayed in the Output section on the Debugger screen.
Steps to add a namespace prefix to a target element
...